Skip to content

Commit ca57a93

Browse files
committed
USPR-13800: bump example spring-framework.version override and add verification task
Add ext['spring-framework.version'] = '7.0.8' to both example subprojects' build.gradle to close the BOM-precedence gap where spring-dependency-management's managed version otherwise overrides the root resolutionStrategy floor. Also add a verifySpringExpressionVersion Gradle task, wired into `check` for every subproject, that fails the build if org.springframework:spring-expression resolves below 7.0.8 anywhere in the dependency graph.
1 parent 0bbc862 commit ca57a93

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,22 @@ subprojects {
124124
consoleOutput = true
125125
ruleSets = ["$rootDir/ruleset.xml"]
126126
}
127+
128+
tasks.register('verifySpringExpressionVersion') {
129+
doLast {
130+
configurations.findAll { it.canBeResolved }.each { config ->
131+
config.incoming.resolutionResult.allDependencies.each { dep ->
132+
if (dep instanceof org.gradle.api.artifacts.result.ResolvedDependencyResult) {
133+
def id = dep.selected.moduleVersion
134+
if (id != null && id.group == 'org.springframework' && id.name == 'spring-expression'
135+
&& id.version < '7.0.8') {
136+
throw new GradleException("org.springframework:spring-expression resolved to ${id.version} in configuration ${config.name}, but must be >= 7.0.8 (GHSA-r5w3-xv2f-j59q)")
137+
}
138+
}
139+
}
140+
}
141+
}
142+
}
143+
144+
tasks.named('check') { dependsOn tasks.named('verifySpringExpressionVersion') }
127145
}

examples/example-spring-boot-starter-web/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ext['jackson-2-bom.version'] = '2.21.5'
1010
ext['logback.version'] = '1.5.34'
1111
ext['netty.version'] = '4.2.16.Final'
1212
ext['tomcat.version'] = '11.0.22'
13+
ext['spring-framework.version'] = '7.0.8'
1314

1415
dependencies {
1516
implementation project(':examples:examples-common')

examples/example-spring-boot-starter-webflux/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ext['jackson-2-bom.version'] = '2.21.5'
1010
ext['logback.version'] = '1.5.34'
1111
ext['netty.version'] = '4.2.16.Final'
1212
ext['tomcat.version'] = '11.0.22'
13+
ext['spring-framework.version'] = '7.0.8'
1314

1415
dependencies {
1516
implementation project(':examples:examples-common')

0 commit comments

Comments
 (0)