build.gradle.kts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. plugins {
  2. id("otel.java-conventions")
  3. alias(springBoot32.plugins.versions)
  4. id("org.graalvm.buildtools.native")
  5. }
  6. description = "smoke-tests-otel-starter-spring-boot-3.2"
  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.springframework.boot:spring-boot-starter-test")
  20. }
  21. springBoot {
  22. mainClass = "io.opentelemetry.spring.smoketest.OtelSpringStarterSmokeTestApplication"
  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. }