build.gradle.kts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
  17. implementation(project(":smoke-tests-otel-starter:spring-boot-common"))
  18. testImplementation("org.springframework.boot:spring-boot-starter-test")
  19. }
  20. springBoot {
  21. mainClass = "io.opentelemetry.spring.smoketest.OtelSpringStarterSmokeTestApplication"
  22. }
  23. tasks {
  24. compileAotJava {
  25. with(options) {
  26. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  27. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  28. // -deprecation,-unchecked and none are required (none is not enough)
  29. }
  30. }
  31. compileAotTestJava {
  32. with(options) {
  33. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  34. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  35. // -deprecation,-unchecked and none are required (none is not enough)
  36. }
  37. }
  38. checkstyleAot {
  39. isEnabled = false
  40. }
  41. checkstyleAotTest {
  42. isEnabled = false
  43. }
  44. }
  45. // To be able to execute the tests as GraalVM native executables
  46. configurations.configureEach {
  47. exclude("org.apache.groovy", "groovy")
  48. exclude("org.apache.groovy", "groovy-json")
  49. exclude("org.spockframework", "spock-core")
  50. }
  51. graalvmNative {
  52. binaries.all {
  53. // Workaround for https://github.com/junit-team/junit5/issues/3405
  54. buildArgs.add("--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig")
  55. buildArgs.add("--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter")
  56. }
  57. // See https://github.com/graalvm/native-build-tools/issues/572
  58. metadataRepository {
  59. enabled.set(false)
  60. }
  61. tasks.test {
  62. useJUnitPlatform()
  63. setForkEvery(1)
  64. }
  65. }