build.gradle.kts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. plugins {
  2. id("otel.java-conventions")
  3. id("org.springframework.boot") version "3.2.5"
  4. id("org.graalvm.buildtools.native")
  5. }
  6. description = "smoke-tests-otel-starter-spring-boot-3"
  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. runtimeOnly("com.h2database:h2")
  14. implementation("org.apache.commons:commons-dbcp2")
  15. implementation("org.springframework.kafka:spring-kafka") // not tested here, just make sure there are no warnings when it's included
  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(":smoke-tests-otel-starter:spring-smoke-testing"))
  21. }
  22. tasks {
  23. test {
  24. // suppress warning about byte-buddy-agent being loaded dynamically
  25. jvmArgs("-XX:+EnableDynamicAgentLoading")
  26. }
  27. compileAotJava {
  28. with(options) {
  29. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  30. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  31. // -deprecation,-unchecked and none are required (none is not enough)
  32. }
  33. }
  34. compileAotTestJava {
  35. with(options) {
  36. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  37. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  38. // -deprecation,-unchecked and none are required (none is not enough)
  39. }
  40. }
  41. checkstyleAot {
  42. isEnabled = false
  43. }
  44. checkstyleAotTest {
  45. isEnabled = false
  46. }
  47. }
  48. // To be able to execute the tests as GraalVM native executables
  49. configurations.configureEach {
  50. exclude("org.apache.groovy", "groovy")
  51. exclude("org.apache.groovy", "groovy-json")
  52. exclude("org.spockframework", "spock-core")
  53. }
  54. graalvmNative {
  55. binaries.all {
  56. // Workaround for https://github.com/junit-team/junit5/issues/3405
  57. buildArgs.add("--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig")
  58. buildArgs.add("--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter")
  59. }
  60. // See https://github.com/graalvm/native-build-tools/issues/572
  61. metadataRepository {
  62. enabled.set(false)
  63. }
  64. tasks.test {
  65. useJUnitPlatform()
  66. setForkEvery(1)
  67. }
  68. }