build.gradle.kts 2.5 KB

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