Skip to content

Commit 87ea55e

Browse files
committed
Support Java 8 and 11 in spring boot smoke test app
1 parent 0bb9375 commit 87ea55e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

smoke-tests/images/spring-boot/build.gradle.kts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ dependencies {
1717
implementation("org.springframework.boot:spring-boot-starter-web")
1818
}
1919

20-
otelJava {
21-
minJavaVersionSupported = JavaVersion.VERSION_17
22-
}
23-
2420
configurations.runtimeClasspath {
2521
resolutionStrategy {
2622
// requires old logback (and therefore also old slf4j)
@@ -34,6 +30,16 @@ val targetJDK = project.findProperty("targetJDK") ?: "17"
3430
val tag = findProperty("tag")
3531
?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now())
3632

33+
java {
34+
// Jib detects the Java version from sourceCompatibility to determine the entrypoint format.
35+
// Java 8 doesn't support the @argfile syntax (added in Java 9), so Jib needs to know
36+
// to use an expanded classpath format instead (e.g., /app/classes:/app/libs/*).
37+
if (targetJDK == "8") {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = JavaVersion.VERSION_1_8
40+
}
41+
}
42+
3743
springBoot {
3844
buildInfo {
3945
}

0 commit comments

Comments
 (0)