Skip to content

Commit ad16ba8

Browse files
authored
Fix using opentelemetry-spring-boot with java8 (#10066)
1 parent 172b2a4 commit ad16ba8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

instrumentation/spring/spring-webmvc/spring-webmvc-6.0/library/build.gradle.kts

+13
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,16 @@ dependencies {
1515
otelJava {
1616
minJavaVersionSupported.set(JavaVersion.VERSION_17)
1717
}
18+
19+
tasks {
20+
compileJava {
21+
// We compile this module for java 8 because it is used as a dependency in spring-boot-autoconfigure.
22+
// If this module is compiled for java 17 then gradle can figure out based on the metadata that
23+
// spring-boot-autoconfigure has a dependency that requires 17 and fails the build when it is used
24+
// in a project that targets an earlier java version.
25+
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/9949
26+
sourceCompatibility = "1.8"
27+
targetCompatibility = "1.8"
28+
options.release.set(null as Int?)
29+
}
30+
}

0 commit comments

Comments
 (0)