Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align versions of transitive dependencies with Grails specified versions #13860

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,30 @@ allprojects {
}
}

configurations {
all {
resolutionStrategy {
def cacheHours = isCiBuild ? 0 : 24
cacheDynamicVersionsFor cacheHours, 'hours'
cacheChangingModulesFor cacheHours, 'hours'
eachDependency { DependencyResolveDetails details ->
//specifying a fixed version for all libraries with 'org.gradle' group
if (details.requested.group == 'org.codehaus.groovy') {
details.useVersion groovyVersion
}
if (details.requested.group == "org.spockframework") {
details.useVersion(spockVersion)
}
configurations.configureEach {
resolutionStrategy {
def cacheHours = isCiBuild ? 0 : 24
cacheDynamicVersionsFor cacheHours, 'hours'
cacheChangingModulesFor cacheHours, 'hours'

// Align versions of transitive dependencies with the version we are using
eachDependency { DependencyResolveDetails details ->
def forcedSpringLibraryUpgrades = ['spring-core', 'spring-jcl', 'spring.orm']
def forcedTomcatLibraryUpgrades = ['tomcat-jdbc', 'tomcat-juli']
if (details.requested.group == 'org.codehaus.groovy') {
details.useVersion(groovyVersion)
}
if (details.requested.group == 'org.spockframework') {
details.useVersion(spockVersion)
}
if (details.requested.group == 'org.springframework' && details.requested.name in forcedSpringLibraryUpgrades) {
details.useVersion(springVersion)
}
if (details.requested.group == 'org.yaml' && details.requested.name == 'snakeyaml') {
details.useVersion(snakeyamlVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we remove snakeyaml since it is commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! I was testing something and missed to enable this again. I am unsure about snakeyaml. 2.0 is pulled in by other libraries. Will it work to force 2.2?

}
if (details.requested.group == 'org.apache.tomcat' && details.requested.name in forcedTomcatLibraryUpgrades) {
details.useVersion(tomcatVersion)
}
}
}
Expand Down
Loading