Skip to content

Commit f4ddd3b

Browse files
committed
Fix EhCache smoke test when building with a toolchain
1 parent f287acd commit f4ddd3b

File tree

1 file changed

+5
-3
lines changed
  • spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache

1 file changed

+5
-3
lines changed

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ configurations {
2121
infinispan
2222
}
2323

24+
def javaVersion() {
25+
project.extensions.java.toolchain.languageVersion.map({ it.asInt() }).getOrElse(JavaVersion.current().majorVersion)
26+
}
27+
2428
dependencies {
2529
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator"))
2630
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-cache"))
@@ -37,9 +41,7 @@ dependencies {
3741
ehcache(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
3842
ehcache("javax.cache:cache-api")
3943
ehcache("org.ehcache:ehcache")
40-
if (JavaVersion.current().java11Compatible) {
41-
ehcache("org.glassfish.jaxb:jaxb-runtime")
42-
}
44+
ehcache(provider({ (javaVersion() >= 11) ? "org.glassfish.jaxb:jaxb-runtime" : null }))
4345
ehcache2(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
4446
ehcache2("net.sf.ehcache:ehcache")
4547

0 commit comments

Comments
 (0)