Skip to content

Commit 9cfd106

Browse files
committed
Fix spring 7 testLatestDeps
1 parent 12874fb commit 9cfd106

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
id("otel.javaagent-testing")
33
}
44

5+
val testLatestDeps = findProperty("testLatestDeps") as Boolean
6+
57
dependencies {
68
testInstrumentation(project(":instrumentation:jdbc:javaagent"))
79
testInstrumentation(project(":instrumentation:r2dbc-1.0:javaagent"))
@@ -20,6 +22,15 @@ dependencies {
2022
testImplementation("org.hsqldb:hsqldb:2.0.0")
2123
testImplementation("com.h2database:h2:1.4.197")
2224
testImplementation("io.r2dbc:r2dbc-h2:1.0.0.RELEASE")
25+
26+
if (testLatestDeps) {
27+
// Exclude Spring Framework 7.0+ until compatible version available
28+
testImplementation("org.springframework:spring-core") {
29+
version {
30+
strictly("[6.0,7.0[")
31+
}
32+
}
33+
}
2334
}
2435

2536
otelJava {

instrumentation/spring/spring-security-config-6.0/javaagent/build.gradle.kts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ muzzle {
1414
}
1515
}
1616

17+
val testLatestDeps = findProperty("testLatestDeps") as Boolean
18+
1719
dependencies {
1820
implementation(project(":instrumentation:spring:spring-security-config-6.0:library"))
1921

@@ -23,11 +25,25 @@ dependencies {
2325

2426
testLibrary("org.springframework:spring-test:6.0.0")
2527
testLibrary("org.springframework:spring-context:6.0.0")
26-
// can't use testLibrary for now because 6.2.0-M1 is latest and its POM referes to a missing
28+
// can't use testLibrary for now because 6.2.0-M1 is latest and its POM refers to a missing
2729
// parent POM, switch back to testLibrary when a new version is released
2830
// testLibrary("jakarta.servlet:jakarta.servlet-api:6.0.0")
2931
testImplementation("jakarta.servlet:jakarta.servlet-api:6.0.0")
3032
latestDepTestLibrary("jakarta.servlet:jakarta.servlet-api:6.1.0") // documented limitation
33+
34+
if (testLatestDeps) {
35+
// Exclude Spring Framework 7.0+ until compatible version available
36+
testImplementation("org.springframework:spring-context") {
37+
version {
38+
strictly("[6.0,7.0[")
39+
}
40+
}
41+
testImplementation("org.springframework:spring-test") {
42+
version {
43+
strictly("[6.0,7.0[")
44+
}
45+
}
46+
}
3147
}
3248

3349
otelJava {

instrumentation/spring/spring-security-config-6.0/library/build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
id("otel.library-instrumentation")
33
}
44

5+
val testLatestDeps = findProperty("testLatestDeps") as Boolean
6+
57
dependencies {
68
library("org.springframework.security:spring-security-config:6.0.0")
79
library("org.springframework.security:spring-security-web:6.0.0")
@@ -17,6 +19,30 @@ dependencies {
1719
implementation(project(":instrumentation:reactor:reactor-3.1:library"))
1820

1921
testLibrary("org.springframework:spring-test:6.0.0")
22+
23+
if (testLatestDeps) {
24+
// Exclude Spring Framework 7.0+ until compatible version available
25+
testImplementation("org.springframework:spring-core") {
26+
version {
27+
strictly("[6.0,7.0[")
28+
}
29+
}
30+
testImplementation("org.springframework:spring-context") {
31+
version {
32+
strictly("[6.0,7.0[")
33+
}
34+
}
35+
testImplementation("org.springframework:spring-web") {
36+
version {
37+
strictly("[6.0,7.0[")
38+
}
39+
}
40+
testImplementation("org.springframework:spring-test") {
41+
version {
42+
strictly("[6.0,7.0[")
43+
}
44+
}
45+
}
2046
}
2147

2248
otelJava {

instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ if (latestDepTest) {
2323
otelJava {
2424
minJavaVersionSupported.set(JavaVersion.VERSION_17)
2525
}
26+
27+
// Exclude Spring Framework 7.0+ until compatible version available
28+
dependencies {
29+
testImplementation("org.springframework:spring-webflux") {
30+
version {
31+
strictly("[6.0,7.0[")
32+
}
33+
}
34+
}
2635
}
2736

2837
if (!latestDepTest) {

0 commit comments

Comments
 (0)