build.gradle.kts 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.elasticsearch.client")
  7. module.set("transport")
  8. versions.set("[5.3.0,6.0.0)")
  9. // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on
  10. // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist
  11. // version 7.17.8 has broken module metadata
  12. skip("7.11.0", "7.17.8")
  13. // version 8.8.0 depends on elasticsearch:elasticsearch-preallocate which doesn't exist
  14. excludeDependency("org.elasticsearch:elasticsearch-preallocate")
  15. assertInverse.set(true)
  16. }
  17. pass {
  18. group.set("org.elasticsearch")
  19. module.set("elasticsearch")
  20. versions.set("[5.3.0,6.0.0)")
  21. // version 7.11.0 depends on org.elasticsearch:elasticsearch-plugin-classloader:7.11.0
  22. // which does not exist
  23. skip("7.11.0")
  24. // version 8.8.0 depends on elasticsearch:elasticsearch-preallocate which doesn't exist
  25. excludeDependency("org.elasticsearch:elasticsearch-preallocate")
  26. assertInverse.set(true)
  27. }
  28. }
  29. if (findProperty("testLatestDeps") as Boolean) {
  30. // when running on jdk 21 Elasticsearch53SpringRepositoryTest occasionally fails with timeout
  31. otelJava {
  32. maxJavaVersionSupported.set(JavaVersion.VERSION_17)
  33. }
  34. }
  35. dependencies {
  36. compileOnly("org.elasticsearch.client:transport:5.3.0") {
  37. isTransitive = false
  38. }
  39. compileOnly("org.elasticsearch:elasticsearch:5.3.0") {
  40. // We don't need all its transitive dependencies when compiling and run tests against 5.5.0
  41. isTransitive = false
  42. }
  43. implementation(project(":instrumentation:elasticsearch:elasticsearch-transport-common:javaagent"))
  44. testInstrumentation(project(":instrumentation:apache-httpasyncclient-4.1:javaagent"))
  45. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  46. testInstrumentation(project(":instrumentation:spring:spring-data:spring-data-1.8:javaagent"))
  47. testImplementation(project(":instrumentation:elasticsearch:elasticsearch-transport-common:testing"))
  48. testImplementation("org.apache.logging.log4j:log4j-core:2.11.0")
  49. testImplementation("org.apache.logging.log4j:log4j-api:2.11.0")
  50. // Unfortunately spring-data-elasticsearch requires 5.5.0
  51. testLibrary("org.elasticsearch.client:transport:5.5.0")
  52. testLibrary("org.elasticsearch.plugin:transport-netty3-client:5.3.0")
  53. testLibrary("org.springframework.data:spring-data-elasticsearch:3.0.0.RELEASE")
  54. latestDepTestLibrary("org.elasticsearch.plugin:transport-netty3-client:5.+") // see elasticsearch-transport-6.0 module
  55. latestDepTestLibrary("org.elasticsearch.client:transport:5.+") // see elasticsearch-transport-6.0 module
  56. latestDepTestLibrary("org.springframework.data:spring-data-elasticsearch:3.0.+")
  57. }
  58. tasks.withType<Test>().configureEach {
  59. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  60. // TODO run tests both with and without experimental span attributes
  61. jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
  62. // required on jdk17
  63. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  64. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  65. }