build.gradle.kts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. plugins {
  2. id("otel.java-conventions")
  3. id("org.springframework.boot") version "3.2.0"
  4. id("org.graalvm.buildtools.native")
  5. }
  6. description = "smoke-tests-otel-starter"
  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. implementation("com.h2database:h2")
  14. implementation("org.apache.commons:commons-dbcp2")
  15. implementation(project(":instrumentation:jdbc:library"))
  16. implementation(project(":instrumentation:spring:starters:spring-boot-starter"))
  17. implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
  18. testImplementation("org.springframework.boot:spring-boot-starter-test")
  19. testImplementation(project(":testing-common"))
  20. }
  21. tasks {
  22. compileAotJava {
  23. with(options) {
  24. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  25. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  26. // -deprecation,-unchecked and none are required (none is not enough)
  27. }
  28. }
  29. compileAotTestJava {
  30. with(options) {
  31. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  32. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  33. // -deprecation,-unchecked and none are required (none is not enough)
  34. }
  35. }
  36. checkstyleAot {
  37. isEnabled = false
  38. }
  39. checkstyleAotTest {
  40. isEnabled = false
  41. }
  42. }
  43. // To be able to execute the tests as GraalVM native executables
  44. configurations.configureEach {
  45. exclude("org.apache.groovy", "groovy")
  46. exclude("org.apache.groovy", "groovy-json")
  47. exclude("org.spockframework", "spock-core")
  48. }
  49. graalvmNative {
  50. binaries.all {
  51. // Workaround for https://github.com/junit-team/junit5/issues/3405
  52. buildArgs.add("--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig")
  53. buildArgs.add("--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter")
  54. }
  55. tasks.test {
  56. useJUnitPlatform()
  57. setForkEvery(1)
  58. }
  59. }