Skip to content

Commit

Permalink
Use groovy 3 for compilation of gradle plugin. Ensure specified versi…
Browse files Browse the repository at this point in the history
…on of groovy 4 on app.
  • Loading branch information
codeconsole committed Sep 13, 2024
1 parent a038abd commit bc8699d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ java {
}

// resolve conflict from Gradle's version of Groovy. Not needed if Gradle switches to 4.0
configurations.configureEach { exclude group: 'org.apache.groovy', module: 'groovy-xml' }
configurations.configureEach { exclude group: 'org.apache.groovy' }

dependencies {
implementation "io.github.gradle-nexus:publish-plugin:2.0.0"
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ projectVersion=7.0.0-SNAPSHOT
grailsVersion=7.0.0-SNAPSHOT
grailsShellVersion=7.0.0-SNAPSHOT
springBootVersion=3.3.3
groovyVersion=4.0.22
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,15 @@ class GrailsGradlePlugin extends GroovyPlugin {
configuration.resolutionStrategy.eachDependency({ DependencyResolveDetails details ->
String dependencyName = details.requested.name
String group = details.requested.group
if (group == 'org.codehaus.groovy' && dependencyName.startsWith('groovy')) {
if (group == 'org.codehaus.groovy') {
if (dependencyName == 'groovy-all') {
details.useTarget "org.apache.groovy:groovy:$groovyVersion"
} else {
details.useTarget "org.apache.groovy:$dependencyName:$groovyVersion"
}
details.because('groovy version substituted for groovy 4')
} else if (group == 'org.apache.groovy' && dependencyName.startsWith('groovy')) {
details.useVersion(groovyVersion)
return
}
} as Action<DependencyResolveDetails>)
} as Action<Configuration>)
Expand Down

0 comments on commit bc8699d

Please sign in to comment.