Fix root Gradle output to ship the server plugin jar #1

Merged
NotAlexNoyle merged 1 commits from codex/fix-gradle-jar-build-configuration into master 2026-03-13 15:01:50 -04:00
NotAlexNoyle commented 2026-03-13 14:58:00 -04:00 (Migrated from github.com)

Motivation

  • The root project produced a CraftingStore-<version>.jar in build/libs that could be missing plugin.yml/paper-plugin.yml, causing Paper/Purpur to reject the uploaded artifact.
  • The assembly artifact (:assembly:shadowJar) is the correct server-installable plugin jar and should be the file placed in the root build/libs for easy installation.

Description

  • Disabled the root shadowJar by setting enabled = false on tasks.shadowJar so the root project no longer emits a misleading artifact.
  • Added a copyServerJarToRootBuildLibs task (type Copy) that depends on :assembly:shadowJar and copies CraftingStore-${rootProject.version}.jar from the :assembly build/libs into the root build/libs directory.
  • Updated tasks.build to depend on spotlessApply and the new copy task so the root build/libs contains the correctly assembled plugin jar after ./gradlew build.
  • File changed: build.gradle.kts.

Testing

  • Ran ./gradlew :assembly:shadowJar which failed in this environment with a Kotlin/Java version parsing error (java.lang.IllegalArgumentException: 25.0.1), preventing a full build verification.
  • Ran ./gradlew :assembly:shadowJar --stacktrace and ./gradlew help which reproduced the same 25.0.1 error, indicating an environment JDK/Kotlin mismatch rather than a packaging regression.
  • The patch was applied and committed successfully (build.gradle.kts updated and committed).

Codex Task

### Motivation - The root project produced a `CraftingStore-<version>.jar` in `build/libs` that could be missing `plugin.yml`/`paper-plugin.yml`, causing Paper/Purpur to reject the uploaded artifact. - The assembly artifact (`:assembly:shadowJar`) is the correct server-installable plugin jar and should be the file placed in the root `build/libs` for easy installation. ### Description - Disabled the root `shadowJar` by setting `enabled = false` on `tasks.shadowJar` so the root project no longer emits a misleading artifact. - Added a `copyServerJarToRootBuildLibs` task (type `Copy`) that depends on `:assembly:shadowJar` and copies `CraftingStore-${rootProject.version}.jar` from the `:assembly` `build/libs` into the root `build/libs` directory. - Updated `tasks.build` to depend on `spotlessApply` and the new copy task so the root `build/libs` contains the correctly assembled plugin jar after `./gradlew build`. - File changed: `build.gradle.kts`. ### Testing - Ran `./gradlew :assembly:shadowJar` which failed in this environment with a Kotlin/Java version parsing error (`java.lang.IllegalArgumentException: 25.0.1`), preventing a full build verification. - Ran `./gradlew :assembly:shadowJar --stacktrace` and `./gradlew help` which reproduced the same `25.0.1` error, indicating an environment JDK/Kotlin mismatch rather than a packaging regression. - The patch was applied and committed successfully (`build.gradle.kts` updated and committed). ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69b45cb5d868832fa11469b6d271de03)
Sign in to join this conversation.