Skip to content
Aithor Dev

Building from Source

On this page

Building from Source

NationCore is a standard Maven project.

Requirements

  • JDK 21 (maven.compiler.release is set to 21).
  • Maven 3.9+ β€” or use the bundled helper script, which downloads a portable Maven for you.

Build

Bash
mvn clean package

The finished jar lands in target/NationCore-2.0.0.jar.

Snapshot builds

The snapshot profile appends a build suffix to the jar name and to the version reported in plugin.yml:

Bash
mvn clean package -Psnapshot
# -> target/NationCore-2.0.0.SNAPSHOT-42.jar

Windows helper script

build.ps1 finds a local JDK, downloads a portable Maven if none is on the PATH, then runs the build:

PowerShell
.\build.ps1                      # same as: mvn clean package
.\build.ps1 -psnapshot           # same as: mvn clean package -Psnapshot
.\build.ps1 clean install -DskipTests

Project layout

Text
src/main/java/id/nationcore/
β”œβ”€β”€ NationCore.java          Plugin entry point: config loading, managers, schedulers
β”œβ”€β”€ api/                     NationCoreAPI β€” the public surface for other plugins
β”œβ”€β”€ commands/                NationCommand β€” /nationcore and its tab completion
β”œβ”€β”€ gui/                     All inventory menus, grouped per government type
β”œβ”€β”€ integration/             FactoryCore, ApartmentCore, land permits, squaremap
β”œβ”€β”€ listeners/               Bukkit event handlers
β”œβ”€β”€ managers/                One manager per system (nations, tax, elections, …)
β”œβ”€β”€ models/                  Plain data classes saved to JSON
β”œβ”€β”€ placeholders/            PlaceholderAPI expansion
└── utils/                   Message formatting and the Vault hook

src/main/resources/
β”œβ”€β”€ plugin.yml               Command, permissions, soft depends
β”œβ”€β”€ config.yml               Main configuration
β”œβ”€β”€ language.yml             All messages
β”œβ”€β”€ order.yaml               Executive-order catalogue
β”œβ”€β”€ research.yml             Research catalogue
β”œβ”€β”€ nations/                 Per-government configuration
└── squaremap/               Live-map HTML templates

Dependencies

All dependencies are provided β€” nothing is bundled into the jar except what the shade plugin repackages.

Dependency Version Why
io.papermc.paper:paper-api 1.21.4-R0.1-SNAPSHOT The server API.
com.github.MilkBowl:VaultAPI 1.7 Economy access.
me.clip:placeholderapi 2.11.6 Placeholder expansion.
xyz.jpenilla:squaremap-api 1.3.4 Live web map. Adventure classes are excluded so Paper's own Adventure version wins.

Repositories used: PaperMC, Spigot snapshots, JitPack and the PlaceholderAPI repo.

Resource filtering

src/main/resources is filtered by Maven, so plugin.yml can use ${project.version} and ${build.suffix}. That is how the snapshot number ends up in the version string the server reports.

Testing a build

  1. Copy the jar into a Paper 1.21.4 test server with Vault and an economy plugin.
  2. Start the server and confirm the splash screen appears.
  3. Run /nc hub, create a nation, and check that plugins/NationCore/data/nations.json is written.

Search documentation

    Type to start searching.