build.gradle.kts 2.4 KB

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