Skip to content

Building from Source

SicklySurgeon edited this page Oct 28, 2026 · 2 revisions

Building from Source

Requirements

Tool Version
JDK 21 or newer (the legacy profile compiles with --release 8)
Maven 3.9 or newer
Git Any recent version

Build

git clone https://github.com/SicklySurgeon/customdeathmessages.git
cd customdeathmessages

mvn clean package            # modern build (default profile)
mvn -Plegacy clean package   # legacy build

The ready-to-install JARs are written to:

target/customdeathmessages-1.7.0-modern.jar
target/customdeathmessages-1.7.0-legacy.jar

The first build downloads the Spigot API and its dependencies from the Spigot snapshot repository, so an internet connection is required.

Build settings

Setting Modern profile Legacy profile
Activation Default -Plegacy
Spigot API 26.3-R0.1-SNAPSHOT 1.8.8-R0.1-SNAPSHOT
Java release 21 8
api-version in plugin.yml 1.21 not declared
Output target/customdeathmessages-<version>-modern.jar target/customdeathmessages-<version>-legacy.jar

api-version is the minimum API version, not the maximum. Declaring 1.21 lets the one modern JAR load on 1.21.x and on 26.x. The legacy JAR omits api-version entirely so 1.8 – 1.20.x servers accept it.

Project layout

Path Contents
src/main/java/com/sicklysurgeon/customdeathmessages/ Plugin entry point, initialization and lifecycle
.../command/ /cdm, /cdmhelp, /cdmreload, /cdmconfig, /cdmbroadcast
.../listener/ Death, damage, respawn and join listeners
.../util/ Config, messages, placeholders, effects, formatting, hooks
.../util/VersionCompat.java Titles, action bars, biome, potion and item access across versions
.../util/ParticleUtil.java Particle reflection, alias table and Effect fallback
.../util/SoundUtil.java Sound reflection and alias chains
src/main/resources/config.yml Default main configuration
src/main/resources/messages.yml Default messages and effects
src/modern/resources/plugin.yml Metadata with api-version: '1.21'
src/legacy/resources/plugin.yml Metadata without api-version
pom.xml Maven build and the modern / legacy profiles

Testing a build

  1. Copy the JAR into a test server's plugins/ folder.
  2. Start the server with a supported Java version (21+ for modern, 8+ for legacy).
  3. Run /cdmconfig validate and /cdm test FALL.

The project has no automated CI workflow, so builds are produced locally.

Releasing a new version

  1. Update <version> in pom.xml.
  2. Update version in src/modern/resources/plugin.yml and src/legacy/resources/plugin.yml.
  3. Optionally update the version headers in config.yml and messages.yml.
  4. Run both builds.
  5. Test the modern JAR on 1.21.x / 26.x and the legacy JAR on 1.8 / 1.12 / 1.16 / 1.20.x.
  6. Tag the release and publish both JARs with the changelog.

Clone this wiki locally