Skip to content

Split CLI dependencies from the runtime classpath - #15948

Merged
jdaugherty merged 17 commits into
8.0.xfrom
fix/split-cli-dependencies
Jul 18, 2026
Merged

jdaugherty merged 17 commits into
8.0.xfrom
fix/split-cli-dependencies

Conversation

@jdaugherty

Copy link
Copy Markdown
Contributor

Description

Grails commands (ApplicationCommand implementations) have always shipped inside runtime plugin
artifacts, dragging CLI-only dependencies onto application runtime classpaths. This causes real
failures: grails-shell-cli leaks a conflicting Groovy onto the app classpath (see the
long-standing exclusion + TODO in grails-data-hibernate{5,7}/dbmigration/build.gradle), and a
CLI-only Spring Boot WebApplicationInitializer breaks classic WAR deployment with an NPE
(#15377) unless users hand-filter the bootWar classpath.

(no classifiers or capability syntax for consumers), fully consumable by Maven as well as Gradle.

Framework changes

  • grails-core-cli: the command contract moves from grails.dev.commands.* to
    org.apache.grails.core.cli.*. Command registrations move from META-INF/grails.factories to a
    dedicated META-INF/grails-cli.factories, written by a new CommandFactoriesTransformation
    that ships in the cli artifact (so it is active exactly when a command can compile). The default
    grails-core jar contains no command code and no command contract.
  • Companion artifacts for all command-bearing modules, each with a unique package and
    Automatic-Module-Name: dbmigration (h5/h7, 29 dbm-* commands each), the hibernate plugins
    (schema-export), scaffolding (9 generate-* commands), web-url-mappings
    (url-mappings-report), spring-security, and spring-security-oauth2. grails-shell-cli is gone
    from every runtime dependency graph.
  • BOM: the base BOM enumerates and manages every companion coordinate.

Build/tooling changes

  • New org.apache.grails.gradle.grails-cli plugin (applied automatically by the Grails
    application/plugin plugins): registers the grailsCli configuration — compile-visible for
    grails-app/commands sources and on the command-runner and test classpaths, but never on the
    main runtimeClasspath, so commands and their CLI-only dependencies are excluded from
    bootRun/bootJar/bootWar. It auto-provisions grails-core-cli + grails-console, and
    discovers plugin companions automatically: a command-bearing plugin advertises its companion
    through a Grails-Cli-Artifact manifest attribute on its runtime jar, and the plugin walks the
    resolved dependency graph (including transitive plugins) and adds each advertised companion to
    grailsCli. Per-command Gradle tasks (dbmUpdate, …) register from the discovered companions —
    no buildscript { classpath } entry needed. Opt out with grails { cliAutoProvision = false }.
    The console/shell tasks draw from the same provisioned tier, so generated apps no longer
    declare console "org.apache.grails:grails-console".
  • New org.apache.grails.gradle.grails-plugin-cli plugin for plugin authors (dogfooded by the
    framework's own modules): one apply sets up the cli source set as a feature variant, the
    command contract on its compile classpath, the manifest advertisement, and the companion
    publication.
  • grails-publish: builds on the additional-publications support added in
    Support additional source sets and custom publishing grails-gradle-publish#34 (requires grails-publish ≥ 1.0.0-SNAPSHOT; the version is
    bumped in dependencies.gradle).
  • Forge/profiles: generated apps declare only runtime plugins; all CLI wiring is automatic.

Consumer impact

Most applications upgrade with no build changes: declaring a command-bearing plugin is enough,
and its commands (and Gradle tasks) follow automatically. Application commands in
grails-app/commands only need the import rename (grails.dev.commands.* →

  • This PR contains a single, focused change.
  • This PR targets the correct branch for the type of change (8.0.x — breaking changes are part of the major release).

Code Quality

  • I have added or updated tests that cover the changes introduced in this PR (module unit
    suites, dbmigration integration tests, the config-report end-to-end integration test
    exercising the full discovery → factories → runner chain, forge feature specs, and
    grails-gradle plugin tests).
  • I have verified that all existing tests pass by running ./gradlew build --rerun-tasks.
  • My code follows the project's code style guidelines (aggregateViolations reports zero
    Checkstyle/CodeNarc/PMD/SpotBugs findings).
  • This PR does not include mass reformatting, style-only changes, or large-scale refactoring
    beyond the approved scope.
  • If generative AI tooling was used in preparing this contribution, a quality model was used to ensure contributions are consistent with the project's quality standards.

Licensing and Attribution

  • All contributed code is provided under the Apache License 2.0, and new source files include the Apache license header.
  • I have the necessary rights to submit this contribution.
  • If generative AI tooling was used in preparing this contribution, I have followed the ASF policy on generative tooling and have properly attributed its use.

Documentation

  • User-facing changes are documented (Creating Custom Commands, Providing Basic Artefacts,
    Gradle plugins catalog, create-command reference).
  • The What's New section covers the companion -cli artifacts, automatic discovery, and the new plugins.
  • The Upgrade Notes (section 33) cover the package renames, the grails-cli.factories
    clean break, the grailsCli configuration, and the third-party plugin migration path.
  • The PR description clearly explains what was changed and why.

@jdaugherty
jdaugherty force-pushed the fix/split-cli-dependencies branch from a7d2537 to 01ddd85 Compare July 9, 2026 19:59
@jdaugherty

Copy link
Copy Markdown
Contributor Author

These were resolving locally due to having maven local search on; I need to fix the dependency substitution to fix these resolution issues.

@codecov

codecov Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.19900% with 361 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.1627%. Comparing base (b980413) to head (d6d49e8).
⚠️ Report is 8 commits behind head on 8.0.x.

Files with missing lines Patch % Lines
...radle/plugin/commands/GrailsCliGradlePlugin.groovy 0.0000% 196 Missing ⚠️
...ugin/commands/GrailsCliArtifactGradlePlugin.groovy 0.0000% 76 Missing ⚠️
...gradle/plugin/commands/CliPublishingSupport.groovy 0.0000% 47 Missing ⚠️
...rg/grails/gradle/plugin/util/ClasspathUtils.groovy 0.0000% 11 Missing ⚠️
...ails/compiler/injection/FactoriesFileWriter.groovy 84.0909% 3 Missing and 4 partials ⚠️
...rails/core/io/support/GrailsFactoriesLoader.groovy 12.5000% 7 Missing ⚠️
...rg/grails/io/support/FactoriesLoaderSupport.groovy 0.0000% 7 Missing ⚠️
...lugin/commands/GrailsCliLibraryGradlePlugin.groovy 0.0000% 4 Missing ⚠️
...g/grails/gradle/plugin/core/GrailsExtension.groovy 33.3333% 2 Missing ⚠️
...ds/factory/ApplicationContextCommandFactory.groovy 0.0000% 2 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             8.0.x     #15948         +/-   ##
================================================
+ Coverage         0   51.1627%   +51.1627%     
- Complexity       0      17588      +17588     
================================================
  Files            0       2032       +2032     
  Lines            0      95212      +95212     
  Branches         0      16530      +16530     
================================================
+ Hits             0      48713      +48713     
- Misses           0      39248      +39248     
- Partials         0       7251       +7251     
Files with missing lines Coverage Δ
...mmand/GrailsApplicationContextCommandRunner.groovy 2.7778% <ø> (ø)
...ion/GlobalGrailsClassInjectorTransformation.groovy 64.0000% <100.0000%> (ø)
...rails/gradle/plugin/core/GrailsGradlePlugin.groovy 0.0000% <0.0000%> (ø)
...ils/gradle/plugin/web/GrailsWebGradlePlugin.groovy 0.0000% <0.0000%> (ø)
...g/grails/gradle/plugin/core/GrailsExtension.groovy 55.8140% <33.3333%> (ø)
...ds/factory/ApplicationContextCommandFactory.groovy 0.0000% <0.0000%> (ø)
...lugin/commands/GrailsCliLibraryGradlePlugin.groovy 0.0000% <0.0000%> (ø)
...ails/compiler/injection/FactoriesFileWriter.groovy 84.0909% <84.0909%> (ø)
...rails/core/io/support/GrailsFactoriesLoader.groovy 47.5000% <12.5000%> (ø)
...rg/grails/io/support/FactoriesLoaderSupport.groovy 0.0000% <0.0000%> (ø)
... and 4 more

... and 2018 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

Turns out there's a real build issue separate from this change, micronaut-singleton isn't including our functional test app so it was pulling from upstream instead of testing with the local copy.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

The published Gradle Module Metadata still contains capability-style dependencies (org.apache.grails:grails-core + requireCapability('org.apache.grails:grails-core-cli')) — violating the split's design rule that external consumers must see the plain -cli coordinate, never capabilities. When Gradle resolves that from a Maven repo, it selects grails-core's cliRuntimeElements variant, follows its available-at redirect to the standalone grails-core-cli module, and then sees both nodes providing the same capability — a self-conflict. I reproduced it with a one-dependency project against build/local-maven, and it fails with both timestamped and non-unique snapshots, so it's not a snapshot-timestamp issue.

There are two distinct leak paths:

  1. Every -cli companion (grails-scaffolding-cli, grails-data-hibernate5-cli, grails-web-url-mappings-cli, dbmigration, spring-security plugins): configureDependencyMapping (publishResolvedCoordinates in GrailsCliArtifactGradlePlugin) rewrites the POM correctly to grails-core-cli, but the GMM still records grails-core + requestedCapabilities — and Gradle consumers prefer the GMM.
  2. grails-console declares the capability dep in its main api (grails-console/build.gradle:43). Its main java component has no dependency mapping at all, so its GMM leaks the capability dep — and worse, its POM collapses it to plain grails-core, meaning Maven consumers silently lose the cli dependency entirely.

I'm still researching possible solutions for this one.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

This is now fixed. We have to support cases where the library is a regular library imported by another project that uses the requireCapbility - this is only when the projects are defined in the same build. I've created a dedicated plugin for this scenario.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right architecture for the CLI split, and most of the execution is excellent for a 260-file change: the renames are mechanically clean (h5/h7 command twins verified line-identical modulo package, no grails.dev.commands stragglers outside migration docs, license headers preserved), the BOM enumerates companion coordinates automatically via the lazy cliArtifactId sweep so there is nothing to keep in sync by hand, the AST transform ordering is verifiably correct with the ConfigReportCommand bootstrap problem cleanly solved, the docs match the implemented behavior including an honest upgrade note on the clean break, and the grailsCli configuration scoping is right (compile/test visible, absent from runtimeClasspath/bootJar/bootWar). The long-standing Groovy-conflict TODO in the dbmigration builds is genuinely resolved rather than papered over.

I left inline comments on the issues I think need resolution before merge — the two blocking ones are the project-dependency companion wiring in GrailsCliGradlePlugin and the 1.0.0-SNAPSHOT of grails-publish flowing into the published BOM. Details and suggested fixes are on the relevant lines.

A few minor items not worth their own threads:

  • GrailsApplicationContextCommandRunner's pre-existing Command not found for name: ... message is now the symptom users will see when a companion was not provisioned; mentioning the grailsCli configuration / -cli artifact in that message would save support traffic.
  • FactoriesFileWriter.addToProps carries over the old substring-based dedup check (existing.contains(classNodeName)), which miscounts when one FQCN is a prefix of another. Pre-existing, not a regression, but this refactor was the natural moment to fix it.
  • Four spring-security command files lost their @author Puneet Behl javadoc tags during the rename (e.g. S2QuickstartCommand) — worth confirming that was intentional.

Comment thread dependencies.gradle Resolved
Comment thread grails-bom/base/build.gradle Resolved
@jdaugherty

Copy link
Copy Markdown
Contributor Author

fixes #15377

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@jamesfredley I'd like to make sure you're ok with the direction this PR takes. Can you review this before Sunday so we can possibly stage the next milestone?

@davydotcom davydotcom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall intent of this PR is quite needed. This has been a problem for a while. Code looks good and while the file changed count is high. Most of that is due to classpath package changes. There are some adjustments that may be merited in a future PR but I dont see anything majorly wrong here. We have a tendancy here to let AI help us review PRs like this and that is awesome but they also can tend to point out issues out of scope or non critical to a merge. It is up to us to take a human look at it first and assess what those agents say if its needed or not. I approve this PR with hte understanding we may have some iteration on future grails 8 point releases to improve edge cases.

Resolve conflicts by keeping CLI companion-artifact changes alongside
Hibernate 7 forge selection and plugin bean lifecycle docs from 8.0.x.

Co-authored-by: Cursor <[email protected]>
@codeconsole

Copy link
Copy Markdown
Contributor

@davydotcom everyone understands AI is not perfect, but if it is going to speed up the time in getting PRs reviewed, I am 100% for it. We need to move things forward at a MUCH faster rate.

Grails has notoriously been wayyy behind on the development cycle and in a constant state of catch up. The fact that it took this simple PR a week to get evaluated showcases this problem.

I invite anyone willing to spend money on tokens on a top tier model to spend some on any PR. Those comments were generated with Fable and done a week before anyone else set eyes on it. It was just meant to get things moving forward.

You are literally responding today to something generated a week ago.

@codeconsole
codeconsole self-requested a review July 17, 2026 16:17
@davydotcom

Copy link
Copy Markdown
Contributor

Didn't say it wasn't

@codeconsole

Copy link
Copy Markdown
Contributor

Didn't say it wasn't

awesome, glad you are onboard. Don't get me wrong, I definitely appreciate all your feedback and contributions.

@jamesfredley

Copy link
Copy Markdown
Contributor

I am for this and the PR looks fine.

But I would want to know the clear path for end apps to quickly upgrade to Grails 8, which they will need to do, when we GA 8.0.0, due to Spring Boot EOL. Will they have to wait on common plugins to re-release and will that bottleneck upgrading to Grails 8.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

I am for this and the PR looks fine.

But I would want to know the clear path for end apps to quickly upgrade to Grails 8, which they will need to do, when we GA 8.0.0, due to Spring Boot EOL. Will they have to wait on common plugins to re-release and will that bottleneck upgrading to Grails 8.

I suspect the breaking part of this PR is only the command part. So from an upgrade perspective, that is likely the only blocker. With that said, we've already made changes to 8.x that will likely break plugins (due to spring boot4 changes). Based on the above, I'm assuming if the core plugin code continues to function, then that's probably good enough to merge.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@scott @davydotcom @jamesfredley I know @jamesfredley brought up purchasing AI credits for key contributors. We should have a wider discussion about this in the weekly. If AI helps us get the reviews done easier, I'm for it. What my concern is is AI generating 100's of PRs that then no one but AI reviews. That's what often gets categorized as "AI Slop" and it can lead to contributor time being wasted. Another way to say this: if AI helps accelerate contributions, great. If AI helps accelerate only commits and then not reviews, it's a major problem for us.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third-party plugin authors: this is the heavy part of the migration

The PR description says most applications upgrade with no build changes, which is accurate for apps. But that promise rests entirely on the plugin ecosystem being rebuilt for Grails 8 first, and the migration burden that lands on third-party plugin authors is worth calling out explicitly in the upgrade notes.

An unchanged Grails 7 command plugin dropped onto a Grails 8 app is not command-compatible - and it fails silently. Three independent reasons, each sufficient on its own:

  1. Its META-INF/grails.factories command entries are never read - ApplicationContextCommandRegistry now loads only META-INF/grails-cli.factories.
  2. Its command implements the now-absent grails.dev.commands.* contract (moved to org.apache.grails.core.cli.*, no forwarding alias).
  3. Its runtime jar lacks the Grails-Cli-Artifact manifest attribute that the app-side GrailsCliGradlePlugin scans for during companion auto-discovery.

The plugin's non-command functionality may keep working, but all of its commands disappear with no error and no warning. There is no transition path where the old packaging keeps working - it is a hard break, not a deprecation.

The supported migration is not a recompile; it is a repackaging with a second published artifact:

  1. Apply org.apache.grails.gradle.grails-plugin-cli.
  2. Move command sources to src/cli/groovy.
  3. Rewrite the contract imports (grails.dev.commands.* -> org.apache.grails.core.cli.*).
  4. Move CLI-only dependencies to cliApi / cliImplementation.
  5. Rename hand-authored registrations from META-INF/grails.factories to META-INF/grails-cli.factories (generated registrations need no file).
  6. Publish the companion -cli artifact alongside the plugin.

Request: since the silent-failure mode is the most user-hostile part, it would help to (a) state prominently in the upgrade notes that unchanged 7.x command plugins lose their commands silently, and (b) consider emitting a build- or runtime-time warning when META-INF/grails.factories still contains ApplicationCommand registrations, so the failure is diagnosable instead of invisible.

Line-level comments follow for the specific correctness bugs found in the new machinery.

Comment thread grails-bom/base/build.gradle Resolved
@jdaugherty

Copy link
Copy Markdown
Contributor Author

I was testing grails-web-console with this code line and seeing what the breakage would be since it doesn't have commands. I can confirm that the plugin should work, but I did find a specific issue on the web console plugin. We removed the get/getAt methods on Metadata as part of the early 8.0 deprecation work. This means the following breaks your app now, unless you fix it:

image

Older grails apps would have generated using this syntax. To @jamesfredley original point, this change is only breaking for the command portion. plugins continue to work with this implementation otherwise.

findAdvertisedCliArtifact returned a bare group:artifactId coordinate for a
companion advertised by a project of the same build, so autoProvisionCliDependencies
added it as an external module dependency — sending Gradle to a repository for a
sibling project's not-yet-published cli variant. Bind a current-build companion as a
project dependency requesting its cli feature capability instead, and keep the module
coordinate path for external and included-build components. Warn when the discovery
probe resolves leniently with failures so dropped companions (and their per-command
tasks) are not silent.

Add CliAutoDiscoverySpec and the cli-companion-autodiscovery test project covering the
project-capability wiring, the guarantee that grailsCli never leaks onto the runtime
classpath, and the cliAutoProvision opt-out.
…dentity

FactoriesFileWriter deduplicated registrations with a substring contains() test,
so two commands whose fully-qualified names are prefixes of one another (Foo vs
FooCommand) collided and the second was silently dropped from the factories file.
Dedup on exact membership instead, and pin the factories write to ISO-8859-1 to
match Properties.load and the reproducible-build rewrite. FactoriesFileWriterSpec
drives the registration end-to-end: concrete subtype registered, abstract base
excluded, prefix-named commands both kept.

The companion -cli constraints were declared only on grails-base-bom, but
enforcedPlatform() enforces a platform's direct constraints, not those inherited
via platform(). An app pinning versions through enforcedPlatform(grails-bom)
received the unversioned *-cli dependencies added by auto-provisioning and failed
to resolve them. Extract the companion-constraint enumeration into a shared script
applied to the base and every derived BOM, so all of them carry the constraints
directly.

Companion discovery now matches a project component to a project of the consuming
build by build tree path instead of assuming the current build is the root build,
so discovery works when the consumer itself is an included build and never binds
to a same-path project of the wrong build.
The cli feature variant kept only the Gradle-computed default capability
(group:name-cli), so an in-build consumer requiring the advertised coordinate of a
companion customized with cliArtifact { artifactId = ... } failed to resolve, and
the published-metadata rewrite only recognized the <module>-cli naming convention,
which would have leaked the capability request into the GMM for customized
coordinates. Customized companions now carry the advertised capability alongside
the default, the rewrite also retargets capabilities matching a companion
advertised by a project of the build, and companion discovery reads the
cliArtifact extension when the producing project's afterEvaluate has not exported
the coordinate property yet.

Covered end to end with a customized acme companion in both test projects:
in-build discovery and resolution through the advertised capability, and
publish/external-resolve with plain coordinates in the pom and module metadata.
FactoriesFileWriterSpec also gains the indirect-implementor case (a command
implementing the contract through a trait).
The upgrade notes and What's New covered the mechanics of the companion-artifact
split but not its bounded impact on upgrading: plugins without commands are
unaffected, command-bearing plugins keep their runtime functionality until
re-released (only their commands are unavailable), and the application's own
commands need only the import rename. Also document the cliArtifact artifactId
customization and its capability semantics.
@jdaugherty

Copy link
Copy Markdown
Contributor Author

@jamesfredley following up on the upgrade-path question: the docs now spell out the bounded impact (upgrade notes §35 "What this change means for upgrading an application" + What's New). Verified empirically as well — a Grails 7 plugin (grails-web-console 7.1.0) runs on a Grails 8 app built from this branch with its runtime functionality intact; the split itself required no plugin changes. Plugin re-releases are only needed for commands (companion -cli artifact) or where a plugin relied on APIs deprecated in 7 and removed in 8.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@jamesfredley Given that:

  1. your time is limited right now to respond & this needs to make it into tomorrow's milestone stage
  2. your comment wasn't a blocking change (requested changes)
  3. all of the comments have been addressed except those that exist with the current code line (gradle task names / incremental compile)
  4. this change doesn't require rebuilding every grails plugin (only if you want the commands, which would indicate active development)
  5. there are multiple other approvals
  6. we can always iterate on this design before a RC or the final release

I'm going to merge this after the tests finish. If you feel this needs reverted, let's revisit.

The arguments/options example read `commandLine.args`: a command has no
`commandLine` property (the GrailsApplicationCommand trait exposes
`executionContext` and an `args` getter for the remaining arguments), and
`--`-prefixed flags are parsed as options rather than remaining arguments, so
the example failed at runtime as written. Use the trait's `args` getter and
`executionContext.commandLine.hasOption(...)`, and correct the surrounding
prose to name `handle()` instead of `run()`.
@testlens-app

testlens-app Bot commented Jul 18, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: d6d49e8
▶️ Tests: 36415 executed
⚪️ Checks: 61/61 completed


Learn more about TestLens at testlens.app.

@jdaugherty
jdaugherty merged commit d1e4af1 into 8.0.x Jul 18, 2026
64 checks passed
@jdaugherty
jdaugherty deleted the fix/split-cli-dependencies branch July 18, 2026 19:49
@jamesfredley jamesfredley linked an issue Jul 22, 2026 that may be closed by this pull request
borinquenkid pushed a commit to borinquenkid/grails-core that referenced this pull request Jul 30, 2026
PR apache#15948 split the CLI command tier off the application runtime classpath.
As part of that split the command contract moved from grails.dev.commands.*
to org.apache.grails.core.cli.* (with no forwarding alias) and command
registration moved from META-INF/grails.factories (key
grails.dev.commands.ApplicationCommand) to META-INF/grails-cli.factories.
The result is that an unchanged, already-published Grails 7 command plugin
silently loses all of its application commands on Grails 8: the command
classes no longer link and their factory entries are never read.

This adds a deprecated compatibility layer that lives entirely in the
grails-core-cli tier (so the runtime classpath split is preserved) and lets
unchanged Grails 7 command plugins keep working without a re-release:

- Restore the deprecated grails.dev.commands.* command contract
  (ApplicationCommand, GrailsApplicationCommand, ExecutionContext and the
  io/template helpers) so pre-compiled Grails 7 command classes link again.
- Adapt legacy commands to the new contract via LegacyApplicationCommandAdapter
  / LegacyApplicationCommandAware, and discover them from the legacy
  META-INF/grails.factories key in ApplicationContextCommandRegistry. Each
  legacy command is instantiated in isolation so one faulty command cannot
  suppress the rest, and a new-contract command always wins a name clash. A
  one-time deprecation warning nudges authors to migrate.
- Unwrap the adapter in GrailsApplicationContextCommandRunner so Spring
  autowiring and the skipBootstrap lookup target the real legacy command that
  is subsequently executed.
- Register per-command Gradle tasks for legacy commands found on the runtime
  classpath, degrading gracefully when the classpath cannot be resolved at
  configuration time (the generic runCommand task always works).

Separately, fix a Groovy 5 regression affecting create-script codegen scripts:
a hyphenated script filename (for example audit-quickstart) produced a class
name without the hyphen, so the command resolved under the wrong name.
GroovyScriptCommandFactory now uses the filename-derived command name.

Adds unit and integration tests (including exception-isolation and
adapter/runner coverage), a real end-to-end functional example under
grails-test-examples/legacy-commands that boots a Grails 8 application and
runs a legacy plugin's ApplicationCommand, GrailsApplicationCommand and
hyphenated script, and upgrade documentation describing the compatibility
path and which command mechanisms are affected.

Assisted-by: claude-code:claude-4.8-opus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Split CLI Dependencies from runtime classpath

5 participants