build.gradle.kts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. plugins {
  2. id("otel.java-conventions")
  3. id("org.springframework.boot") version "3.2.3"
  4. id("org.graalvm.buildtools.native")
  5. }
  6. description = "smoke-tests-otel-starter"
  7. otelJava {
  8. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  9. }
  10. dependencies {
  11. implementation("org.springframework.boot:spring-boot-starter-web")
  12. implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
  13. implementation("com.h2database:h2")
  14. implementation("org.apache.commons:commons-dbcp2")
  15. implementation(project(":instrumentation:jdbc:library"))
  16. implementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
  17. implementation(project(":instrumentation:spring:starters:spring-boot-starter"))
  18. implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
  19. testImplementation("org.springframework.boot:spring-boot-starter-test")
  20. testImplementation(project(":testing-common"))
  21. }
  22. tasks {
  23. compileAotJava {
  24. with(options) {
  25. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  26. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  27. // -deprecation,-unchecked and none are required (none is not enough)
  28. }
  29. }
  30. compileAotTestJava {
  31. with(options) {
  32. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  33. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  34. // -deprecation,-unchecked and none are required (none is not enough)
  35. }
  36. }
  37. checkstyleAot {
  38. isEnabled = false
  39. }
  40. checkstyleAotTest {
  41. isEnabled = false
  42. }
  43. }
  44. // To be able to execute the tests as GraalVM native executables
  45. configurations.configureEach {
  46. exclude("org.apache.groovy", "groovy")
  47. exclude("org.apache.groovy", "groovy-json")
  48. exclude("org.spockframework", "spock-core")
  49. }
  50. graalvmNative {
  51. binaries.all {
  52. // Workaround for https://github.com/junit-team/junit5/issues/3405
  53. buildArgs.add("--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig")
  54. buildArgs.add("--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter")
  55. }
  56. // See https://github.com/graalvm/native-build-tools/issues/572
  57. metadataRepository {
  58. enabled.set(false)
  59. }
  60. tasks.test {
  61. useJUnitPlatform()
  62. setForkEvery(1)
  63. }
  64. }