Skip to content

Commit 9a6f5d4

Browse files
committed
Disable testSpring3 when testJavaVersion is 8 or 11
1 parent 506ee17 commit 9a6f5d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ if (latestDepTest) {
114114
}
115115
}
116116

117+
val testJavaVersion = gradle.startParameter.projectProperties["testJavaVersion"]?.let(JavaVersion::toVersion)
118+
val testSpring3 = (testJavaVersion == null || testJavaVersion.compareTo(JavaVersion.VERSION_17) >= 0)
119+
117120
testing {
118121
suites {
119122
val testLogbackAppender by registering(JvmTestSuite::class) {
@@ -204,6 +207,10 @@ tasks {
204207
options.release.set(17)
205208
}
206209

210+
named<Test>("testSpring3") {
211+
isEnabled = testSpring3
212+
}
213+
207214
withType(Jar::class) {
208215
from(sourceSets["javaSpring3"].output)
209216
}

0 commit comments

Comments
 (0)