jamesfredley opened a new pull request, #16082: URL: https://github.com/apache/grails-core/pull/16082
## Summary Addresses #16035 on top of the CLI split (#15948) and legacy command compatibility (#16011). When a plugin applies `org.apache.grails.gradle.grails-plugin-cli`, `src/main/scripts` command resources (`*.groovy`, `*.yml`, `*.json`) are packaged into the companion `-cli` jar as `META-INF/commands` instead of the runtime plugin jar. That keeps command-only resources off `runtimeClasspath` / `bootJar` / `bootWar` while remaining available through `grailsCliClasspath`. ### Backwards compatibility Plugins **without** a companion keep the historical behavior: scripts still ship in the runtime jar so unmigrated Grails 7 plugins and `legacyCommandSupport` consumers continue to discover them (including the end-to-end `legacy-commands` fixture). ### Incremental migration After enabling `grails-plugin-cli`, a `cleanStaleRuntimeCommandResources` task wipes `META-INF/commands` under the configured `processResources` destination before main resources are processed. That removes prior `src/main/scripts` copies left by non-companion builds; `processResources` then restores any hand-authored `src/main/resources/META-INF/commands`. ## Test plan - [x] `:grails-gradle-plugins:test --tests PluginScriptCommandPackagingSpec` (companion + non-companion jar contents, stale cleanup, hand-authored main resources, templates) - [x] Related CLI specs: `CliAutoDiscoverySpec`, `CliCompanionPublishingSpec`, `LegacyCommandTaskDiscoverySpec`, `BomCliMultiprojectRaceFunctionalSpec` ## Docs - `providingBasicArtefacts.adoc` - `creatingCustomCommands.adoc` - `upgrading80x.adoc` (CLI companion section) Fixes #16035 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
