build.gradle.kts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. plugins {
  2. id("otel.library-instrumentation")
  3. }
  4. dependencies {
  5. compileOnly("org.springframework:spring-webmvc:6.0.0")
  6. compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0")
  7. testImplementation(project(":testing-common"))
  8. testImplementation("org.springframework.boot:spring-boot-starter-web:3.0.0")
  9. testImplementation("org.springframework.boot:spring-boot-starter-test:3.0.0")
  10. }
  11. // spring 6 requires java 17
  12. otelJava {
  13. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  14. }
  15. tasks {
  16. compileJava {
  17. // We compile this module for java 8 because it is used as a dependency in spring-boot-autoconfigure.
  18. // If this module is compiled for java 17 then gradle can figure out based on the metadata that
  19. // spring-boot-autoconfigure has a dependency that requires 17 and fails the build when it is used
  20. // in a project that targets an earlier java version.
  21. // https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/9949
  22. sourceCompatibility = "1.8"
  23. targetCompatibility = "1.8"
  24. options.release.set(null as Int?)
  25. }
  26. }