Include processed resources in shadow JAR and fallback to default particles menu #3

Closed
NotAlexNoyle wants to merge 1 commits from codex/fix-particles.yml-not-copied-to-jar-y5hbhy into master
pull from: codex/fix-particles.yml-not-copied-to-jar-y5hbhy
NotAlexNoyle commented 2026-01-03 08:00:28 -05:00 (Migrated from github.com)

Motivation

  • Ensure plugin.yml token expansions (e.g. api-version) are preserved in the shaded JAR by packaging processed resources rather than raw resource files.
  • Provide a safe fallback for particle menus so the plugin does not fail when a versioned particles_<version>.yml is missing.
  • Prevent runtime failures when importing default menus into the database by shipping built-in menus/*.yml files.

Description

  • Updated tasks.shadowJar to include processed resources via from(sourceSets.main.get().output) so resource filtering and token expansion are packaged into the shaded JAR.
  • Added fallback logic in ResourceUtil.getMostCompatibleParticlesMenu() to return core.getResource("menus/particles.yml") when the versioned menu resource is not present.
  • Left existing shadow exclusions and relocation settings intact to preserve packaging behavior.

Testing

  • Ran ./gradlew processResources, which completed successfully and produced build/resources/main/menus containing particles.yml and purchase_menu.yml.
  • Attempted ./gradlew shadowJar, which failed due to external dependency resolution errors (HTTP 403) unrelated to resource packaging.
  • No additional automated builds were run after switching to from(sourceSets.main.get().output).

Codex Task

### Motivation - Ensure `plugin.yml` token expansions (e.g. `api-version`) are preserved in the shaded JAR by packaging processed resources rather than raw resource files. - Provide a safe fallback for particle menus so the plugin does not fail when a versioned `particles_<version>.yml` is missing. - Prevent runtime failures when importing default menus into the database by shipping built-in `menus/*.yml` files. ### Description - Updated `tasks.shadowJar` to include processed resources via `from(sourceSets.main.get().output)` so resource filtering and token expansion are packaged into the shaded JAR. - Added fallback logic in `ResourceUtil.getMostCompatibleParticlesMenu()` to return `core.getResource("menus/particles.yml")` when the versioned menu resource is not present. - Left existing shadow exclusions and relocation settings intact to preserve packaging behavior. ### Testing - Ran `./gradlew processResources`, which completed successfully and produced `build/resources/main/menus` containing `particles.yml` and `purchase_menu.yml`. - Attempted `./gradlew shadowJar`, which failed due to external dependency resolution errors (HTTP 403) unrelated to resource packaging. - No additional automated builds were run after switching to `from(sourceSets.main.get().output)`. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69590ba2c004832fa163bd963c6813a7)

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.