You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "ltamaster (via GitHub)" <gi...@apache.org> on 2026/03/30 21:25:15 UTC
[I] grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference [grails-core]
ltamaster opened a new issue, #15539:
URL: https://github.com/apache/grails-core/issues/15539
### Expected Behavior
When upgrading to Grails 7.0.9, the build should succeed when using the standard Groovy 4.x group redirection strategy. The grails-gradle-bom:7.0.9 artifact should reference the correct Apache Groovy 4.x BOM:
```
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-bom</artifactId>
<version>4.0.30</version>
<type>pom</type>
<scope>import</scope>
</dependency>
```
### Actual Behaviour
Build fails with dependency resolution error. The published POM for grails-gradle-bom:7.0.9 incorrectly references the legacy Groovy 3.x BOM:
Maven Central POM: https://repo1.maven.org/maven2/org/apache/grails/grails-gradle-bom/7.0.9/grails-gradle-bom-7.0.9.pom (lines 165-170)
```
<dependency>
<groupId>org.codehaus.groovy</groupId> <!-- ❌ Wrong: legacy group (Groovy 3.x) -->
<artifactId>groovy-bom</artifactId>
<version>3.0.25</version> <!-- ❌ Wrong: incompatible with Grails 7 -->
<type>pom</type>
<scope>import</scope>
</dependency>
```
Why this breaks: When projects use standard Groovy group redirection (org.codehaus.groovy → org.apache.groovy), Gradle tries to resolve org.apache.groovy:groovy-bom:3.0.25 which doesn't exist (Apache Groovy starts at 4.x), causing variant mismatch errors.
Full error message:
```
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rundeckapp:assetCompile'.
> Could not resolve all files for configuration ':rundeckapp:runtimeClasspath'.
> Could not resolve org.codehaus.groovy:groovy-bom:3.0.25.
Required by:
project :rundeckapp > org.apache.grails:grails-bom:7.0.9 > org.apache.grails.gradle:grails-gradle-model:7.0.9 > org.apache.grails:grails-gradle-bom:7.0.9
> No matching variant of org.apache.groovy:groovy-bom:4.0.30 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements':
- Incompatible because this component declares a platform for use during compile-time and the consumer needed a library for use during runtime
- Variant 'enforcedApiElements':
- Incompatible because this component declares an enforced platform for use during compile-time and the consumer needed a library for use during runtime
- Variant 'enforcedRuntimeElements' declares a component for use during runtime:
- Incompatible because this component declares an enforced platform and the consumer needed a library
- Variant 'runtimeElements' declares a component for use during runtime:
- Incompatible because this component declares a platform and the consumer needed a library
* Try:
> No matching variant errors are explained in more detail at https://docs.gradle.org/8.14.4/userguide/variant_model.html#sub:variant-no-match.
```
### Steps To Reproduce
Create a new Grails 7.0.9 project:
```
grails create-app myapp --profile=web --version=7.0.9
cd myapp
```
In build.gradle, add the standard Groovy 4.x group redirection (recommended for migrating from Groovy 3.x to 4.x):
```
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'org.codehaus.groovy') {
details.useTarget(
group: 'org.apache.groovy',
name: details.requested.name,
version: '4.0.30'
)
}
}
}
}
}
```
Ensure grails-bom is imported (usually already present in Grails apps):
```
dependencies {
implementation platform("org.apache.grails:grails-bom:$grailsVersion")
// ... other dependencies
}
```
Run the build:
```
./gradlew build
```
Result: Build fails with the error shown in "Actual Behaviour" above
### Environment Information
Operating System: macOS 14.x / Linux (reproducible on both)
JDK: OpenJDK 17.0.8 (OpenJDK Runtime Environment Zulu17.44+15-CA (build 17.0.8+7-LTS))
Gradle: 8.14.4
Groovy: 4.0.30 (expected)
### Example Application
https://github.com/rundeck/rundeck
### Version
7.0.9
--
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: notifications-unsubscribe@grails.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference [grails-core]
Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on issue #15539:
URL: https://github.com/apache/grails-core/issues/15539#issuecomment-4158793608
## Root Cause
Grails publishes **two separate BOMs** that serve different purposes:
| BOM | Groovy Coordinates | Groovy Version | Purpose |
|---|---|---|---|
| `grails-bom` | `org.apache.groovy:groovy-bom` | 4.0.30 | Your application code (runs on Groovy 4) |
| `grails-gradle-bom` | `org.codehaus.groovy:groovy-bom` | 3.0.25 | Grails Gradle plugins (run inside Gradle 8's JVM, which embeds Groovy 3) |
This is by design - Gradle 8 ships with Groovy 3.x (`org.codehaus.groovy`), so the Gradle plugin BOM correctly aligns to Gradle's embedded Groovy version.
The problem is that `grails-gradle-bom` leaks into your application's dependency graph through this transitive chain:
```
your-app
→ grails-bom:7.0.9 (constraint for grails-gradle-model)
→ grails-bootstrap
→ grails-gradle-model:7.0.9
→ grails-gradle-bom:7.0.9
→ org.codehaus.groovy:groovy-bom:3.0.25 ← Groovy 3 reference leaks here
```
Without the group redirection strategy, this resolves fine because `org.codehaus.groovy:groovy-bom:3.0.25` exists on Maven Central and just adds version constraints (it doesn't pull in Groovy 3 jars).
However, your `eachDependency` redirect rewrites it to `org.apache.groovy:groovy-bom:3.0.25`, which doesn't exist - Apache Groovy coordinates only start at version 4.0.
## Workaround
Guard the redirect with a version check so it only applies to Groovy 4.x coordinates:
```groovy
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'org.codehaus.groovy'
&& !details.requested.version.startsWith('3.')) {
details.useTarget(
group: 'org.apache.groovy',
name: details.requested.name,
version: '4.0.30'
)
}
}
}
}
}
```
This skips the redirect for Groovy 3.x dependencies (which come from the Gradle plugin BOM) while still redirecting any Groovy 4.x references that use the old coordinates.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty closed issue #15539: grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference
URL: https://github.com/apache/grails-core/issues/15539
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #15539:
URL: https://github.com/apache/grails-core/issues/15539#issuecomment-4190484440
I'm closing this as this is by design since it's for gradle.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] grails-gradle-bom:7.0.9 contains incorrect groovy-bom dependency reference [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #15539:
URL: https://github.com/apache/grails-core/issues/15539#issuecomment-4162914177
We also support setting `groovy.version` for this exact reason. It will add the code that James suggested in the previous comment.
Longer term, we plan to force plugins to split packages for gradle vs grails dependencies. Plugin scripts really should not be shipped a long side application code.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org