Fix Gradle packaging so plugin jar includes plugin.yml #1

Merged
NotAlexNoyle merged 1 commits from codex/fix-runtime-error-in-fastcrystals-plugin into main 2026-03-16 06:27:03 -04:00
NotAlexNoyle commented 2026-03-16 06:26:54 -04:00 (Migrated from github.com)

Motivation

  • The root build produced an empty top-level FastCrystals-1.0.jar that lacked plugin.yml, causing Paper to refuse loading the plugin.
  • The shared shadow configuration was not being applied because the root script checked the wrong shadow plugin id.

Description

  • Updated the root build.gradle.kts to use the actual shadow plugin id com.gradleup.shadow so the shadowJar configuration applies to subprojects using Shadow.
  • Disabled the root jar task by marking it enabled = false to prevent emitting an empty top-level jar that has no plugin descriptor.
  • Made root assemble depend on :core:shadowJar so the produced top-level artifact comes from the core module shadow jar (which contains plugin.yml).
  • Added an import for Jar to the root build script to configure the root jar task.

Testing

  • Attempted ./gradlew :v1_19_4:jar -q, but the build failed early due to the container JDK reporting 25.0.1, which triggers a Kotlin DSL parser error (java.lang.IllegalArgumentException: 25.0.1).
  • Attempted ./gradlew :v1_19_4:jar --stacktrace to capture full failure details, which confirmed the JVM-version parsing error originates from the environment and not the Gradle wiring changes.
  • Structural verification by inspecting build.gradle.kts confirms the shadow configuration now targets the correct plugin id and the root jar is disabled, addressing the cause of the missing plugin.yml in the top-level jar.

Codex Task

### Motivation - The root build produced an empty top-level `FastCrystals-1.0.jar` that lacked `plugin.yml`, causing Paper to refuse loading the plugin. - The shared shadow configuration was not being applied because the root script checked the wrong shadow plugin id. ### Description - Updated the root `build.gradle.kts` to use the actual shadow plugin id `com.gradleup.shadow` so the `shadowJar` configuration applies to subprojects using Shadow. - Disabled the root `jar` task by marking it `enabled = false` to prevent emitting an empty top-level jar that has no plugin descriptor. - Made root `assemble` depend on `:core:shadowJar` so the produced top-level artifact comes from the `core` module shadow jar (which contains `plugin.yml`). - Added an import for `Jar` to the root build script to configure the root `jar` task. ### Testing - Attempted `./gradlew :v1_19_4:jar -q`, but the build failed early due to the container JDK reporting `25.0.1`, which triggers a Kotlin DSL parser error (`java.lang.IllegalArgumentException: 25.0.1`). - Attempted `./gradlew :v1_19_4:jar --stacktrace` to capture full failure details, which confirmed the JVM-version parsing error originates from the environment and not the Gradle wiring changes. - Structural verification by inspecting `build.gradle.kts` confirms the shadow configuration now targets the correct plugin id and the root jar is disabled, addressing the cause of the missing `plugin.yml` in the top-level jar. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69b7d9add50c832faab569c0b1e9dc94)
Sign in to join this conversation.