Skip to content

Contributing

TechnoVisionDev edited this page Sep 8, 2026 · 2 revisions

Building and contributing

Wiki home · Player commands · Get help

Build and test the plugin source, then prepare changes that preserve existing game state.

This wiki documents Civilizations 1.0.1. Numbers are bundled defaults; in-game menus and previews show your server’s current values.

On this page: Local build · Optional MySQL integration tests · Repository layout · Git hygiene and contribution notes

Local build

mvn clean verify

The result is target/Civilizations-1.0.1.jar. Java 25 and Maven are required. Spigot is a provided dependency; HikariCP, MySQL Connector/J, Gson, and the logging bridge are included through the shaded build. Do not copy those dependency JARs individually into the game server's plugins directory.

For a local package without tests:

mvn -DskipTests package

Use the full verification build before releasing. Normal tests run without a live Minecraft server. Database integration tests are opt-in and are skipped unless enabled. Automated tests do not replace in-game checks of actual world generation, plugin integrations, GUIs, or performance.

Optional MySQL integration tests

Use a dedicated disposable test schema, never a production database. The migration test applies real migrations; the tax integration tests exercise billing and recovery against MySQL.

The test suite reads these Java system properties:

Property Meaning
civilizations.mysql.it Set to true to enable MySQL integration tests
civilizations.mysql.url JDBC URL for the isolated test schema
civilizations.mysql.user Test database user; defaults to root if omitted
civilizations.mysql.password Test database password; defaults to empty if omitted

To keep the password out of the command itself, create .mvn/mysql-it.local.properties (ignored by the plugin source repository):

civilizations.mysql.it=true
civilizations.mysql.url=jdbc:mysql://127.0.0.1:3306/civilizations_test
civilizations.mysql.user=civilizations_test
civilizations.mysql.password=replace-with-test-password

Pass it to Surefire's system-properties file option:

mvn -Dsurefire.systemPropertiesFile=.mvn/mysql-it.local.properties verify

Keep this file private. Java properties-file escaping applies to backslashes and special characters in its values. Test reports can include system properties, so treat target/surefire-reports/ as private when running with database credentials.

These credentials belong only to the test environment. The plugin's live config.yml is separate; runtime configuration does not automatically read these test properties or a .env file.

Repository layout

pom.xml                         Java target, dependencies, test/build configuration
README.md                       Hosting guide and player wiki
CHANGELOG.md                    Release history
docs/OPERATIONS.md              Detailed administrator and recovery runbook
src/main/java/.../              Plugin code
  command/                     Commands and confirmation menus
  config/                      Settings, catalogs, text formatting
  domain/                      Civilization, claim, member, research, war models
  database/                    Storage, migrations, queries
  cache/                       Read snapshots
  service/                     Lifecycle, territory, progression, economy, religion, war
  listener/                    Gameplay events, protection, menus
  runtime/                     Travel, chat, scheduled activity/tax work
  integration/                 Optional plugin adapters
src/main/resources/            Default YAML catalogs and database migration SQL
src/test/java/.../             Unit and opt-in integration tests
target/                        Generated classes, test reports, release JAR (ignored)

Git hygiene and contribution notes

The supplied .gitignore excludes Maven output, IDE/OS files, local Minecraft server directories, logs, crash dumps, backup files, local credentials, and private Maven test settings. Keep local servers under server/, test-server/, dev-server/, or run/, or outside the checkout. Add a local rule if using a different runtime directory.

Default YAML files and migration SQL remain trackable. There is no blanket *.yml, *.sql, or *.jar ignore rule; a Maven wrapper JAR could be committed if a wrapper is added later. Prefer attaching built plugin JARs to a release rather than committing generated target/ contents.

Ignore rules do not remove files that Git already tracks and do not erase secrets from history. Check the staged file list before a public push. Sanitized .env.example / .env.sample files are allowed, but this plugin does not itself load them as runtime configuration.

For code changes, add focused tests for meaningful behavior, preserve the distinction between civilization sovereignty and private ownership, and keep database mutations transactional. Add a new ordered migration for a schema change; never rewrite one already deployed. Update the command/catalog documentation and changelog when player-visible behavior changes.

The supplied source has no license file; this wiki does not assign a software license.


Continue reading: Server setup and installation · Configuration reference · Administration and maintenance

Clone this wiki locally