Include resources in shadow jar and fallback to default particles menu #2

Merged
NotAlexNoyle merged 1 commits from codex/fix-particles.yml-not-copied-to-jar-3akcya into master 2026-01-03 07:50:43 -05:00
NotAlexNoyle commented 2026-01-03 07:50:33 -05:00 (Migrated from github.com)

Motivation

  • Ensure the plugin bundles built-in menu resources so the menus folder is not empty at runtime when creating the shaded jar.
  • Provide a safe fallback for particle menus when a versioned menu resource is not present in the JAR.
  • Prevent runtime failures caused by missing menu resources when importing default menus into the database.

Description

  • Added a fallback in ResourceUtil.getMostCompatibleParticlesMenu() to return core.getResource("menus/particles.yml") when the versioned resource is missing.
  • Updated build.gradle.kts to include main resources in the shadow JAR by adding from(sourceSets.main.get().resources) to the tasks.shadowJar configuration.
  • These changes ensure both that the code tries the default particles.yml and that shipped menus/*.yml files are packaged into the final shaded artifact.

Testing

  • Ran ./gradlew processResources, which completed successfully and build/resources/main/menus contained particles.yml and purchase_menu.yml.
  • Attempted ./gradlew shadowJar, which failed earlier due to external dependency resolution errors (HTTP 403 from remote repositories) unrelated to resource packaging.
  • No automated shadow jar build was executed after adding from(sourceSets.main.get().resources) in this rollout due to the external dependency resolution issue.

Codex Task

### Motivation - Ensure the plugin bundles built-in menu resources so the `menus` folder is not empty at runtime when creating the shaded jar. - Provide a safe fallback for particle menus when a versioned menu resource is not present in the JAR. - Prevent runtime failures caused by missing menu resources when importing default menus into the database. ### Description - Added a fallback in `ResourceUtil.getMostCompatibleParticlesMenu()` to return `core.getResource("menus/particles.yml")` when the versioned resource is missing. - Updated `build.gradle.kts` to include main resources in the shadow JAR by adding `from(sourceSets.main.get().resources)` to the `tasks.shadowJar` configuration. - These changes ensure both that the code tries the default `particles.yml` and that shipped `menus/*.yml` files are packaged into the final shaded artifact. ### Testing - Ran `./gradlew processResources`, which completed successfully and `build/resources/main/menus` contained `particles.yml` and `purchase_menu.yml`. - Attempted `./gradlew shadowJar`, which failed earlier due to external dependency resolution errors (HTTP 403 from remote repositories) unrelated to resource packaging. - No automated shadow jar build was executed after adding `from(sourceSets.main.get().resources)` in this rollout due to the external dependency resolution issue. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69590ba2c004832fa163bd963c6813a7)
Sign in to join this conversation.