Skip to content

Commit 0870a69

Browse files
authored
fix(deps): Align versions of transitive dependencies with Grails specified versions (#13860)
Ensure consistent versions of `spring-core`, `spring-jcl`, `spring-orm`, `snakeyaml`, `tomcat-jdbc` and `tomcat-jul` across all transitive dependencies. This resolves potential version conflicts caused by different versions being pulled in by other dependencies. Closes #13856
1 parent 50fc30a commit 0870a69

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

build.gradle

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,30 @@ allprojects {
232232
}
233233
}
234234

235-
configurations {
236-
all {
237-
resolutionStrategy {
238-
def cacheHours = isCiBuild ? 0 : 24
239-
cacheDynamicVersionsFor cacheHours, 'hours'
240-
cacheChangingModulesFor cacheHours, 'hours'
241-
eachDependency { DependencyResolveDetails details ->
242-
//specifying a fixed version for all libraries with 'org.gradle' group
243-
if (details.requested.group == 'org.codehaus.groovy') {
244-
details.useVersion groovyVersion
245-
}
246-
if (details.requested.group == "org.spockframework") {
247-
details.useVersion(spockVersion)
248-
}
235+
configurations.configureEach {
236+
resolutionStrategy {
237+
def cacheHours = isCiBuild ? 0 : 24
238+
cacheDynamicVersionsFor cacheHours, 'hours'
239+
cacheChangingModulesFor cacheHours, 'hours'
240+
241+
// Align versions of transitive dependencies with the version we are using
242+
eachDependency { DependencyResolveDetails details ->
243+
def forcedSpringLibraryUpgrades = ['spring-core', 'spring-jcl', 'spring.orm']
244+
def forcedTomcatLibraryUpgrades = ['tomcat-jdbc', 'tomcat-juli']
245+
if (details.requested.group == 'org.codehaus.groovy') {
246+
details.useVersion(groovyVersion)
247+
}
248+
if (details.requested.group == 'org.spockframework') {
249+
details.useVersion(spockVersion)
250+
}
251+
if (details.requested.group == 'org.springframework' && details.requested.name in forcedSpringLibraryUpgrades) {
252+
details.useVersion(springVersion)
253+
}
254+
if (details.requested.group == 'org.yaml' && details.requested.name == 'snakeyaml') {
255+
details.useVersion(snakeyamlVersion)
256+
}
257+
if (details.requested.group == 'org.apache.tomcat' && details.requested.name in forcedTomcatLibraryUpgrades) {
258+
details.useVersion(tomcatVersion)
249259
}
250260
}
251261
}

0 commit comments

Comments
 (0)