Fix Bukkit plugin main class relocation in shaded JAR #2

Merged
NotAlexNoyle merged 1 commits from codex/fix-runtime-error-in-gradle-jar-build into master 2026-03-13 13:42:30 -04:00
NotAlexNoyle commented 2026-03-13 13:42:20 -04:00 (Migrated from github.com)

Motivation

  • The Bukkit shaded JAR was relocating package names which moved the plugin main class away from org.popcraft.chunky.ChunkyBukkit, causing InvalidPluginException: Cannot find main class org.popcraft.chunky.ChunkyBukkit at runtime.

Description

  • Disabled package relocation for the Bukkit module's shadowJar task by setting isEnableRelocation = false in bukkit/build.gradle.kts so the plugin main class remains at its expected package.
  • Kept the targeted relocation of org.bstats intact via an explicit relocate call so bundled library packages remain isolated.

Testing

  • Ran ./gradlew :Chunky-bukkit:shadowJar, but the build did not complete due to a Kotlin/Java toolchain parsing error (IllegalArgumentException: 25.0.1) that occurred before task execution and blocked validation (failed).
  • Verified the plugin.yml main entry remains ${group}.chunky.ChunkyBukkit and confirmed the plugin class org.popcraft.chunky.ChunkyBukkit exists in bukkit/src/main/java via repository inspection (succeeded).

Codex Task

### Motivation - The Bukkit shaded JAR was relocating package names which moved the plugin main class away from `org.popcraft.chunky.ChunkyBukkit`, causing `InvalidPluginException: Cannot find main class org.popcraft.chunky.ChunkyBukkit` at runtime. ### Description - Disabled package relocation for the Bukkit module's `shadowJar` task by setting `isEnableRelocation = false` in `bukkit/build.gradle.kts` so the plugin main class remains at its expected package. - Kept the targeted relocation of `org.bstats` intact via an explicit `relocate` call so bundled library packages remain isolated. ### Testing - Ran `./gradlew :Chunky-bukkit:shadowJar`, but the build did not complete due to a Kotlin/Java toolchain parsing error (`IllegalArgumentException: 25.0.1`) that occurred before task execution and blocked validation (failed). - Verified the `plugin.yml` main entry remains ` ${group}.chunky.ChunkyBukkit` and confirmed the plugin class `org.popcraft.chunky.ChunkyBukkit` exists in `bukkit/src/main/java` via repository inspection (succeeded). ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69b44b6275b4832fbda805418da93468)
Sign in to join this conversation.