build.gradle.kts 957 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("log4j")
  7. module.set("log4j")
  8. versions.set("[1.2,)")
  9. // version 1.2.15 has a bad dependency on javax.jms:jms:1.1 which was released as pom only
  10. skip("1.2.15")
  11. }
  12. }
  13. dependencies {
  14. // 1.2 introduces MDC and there's no version earlier than 1.2.4 available
  15. library("log4j:log4j:1.2.4")
  16. }
  17. configurations {
  18. // In order to test the real log4j library we need to remove the log4j transitive
  19. // dependency 'log4j-over-slf4j' brought in by :testing-common which would shadow
  20. // the log4j module under test using a proxy to slf4j instead.
  21. testImplementation {
  22. exclude("org.slf4j", "log4j-over-slf4j")
  23. }
  24. // See: https://stackoverflow.com/a/9047963/2749853
  25. testImplementation {
  26. exclude("javax.jms", "jms")
  27. }
  28. }
  29. tasks {
  30. test {
  31. jvmArgs("-Dotel.instrumentation.common.mdc.resource-attributes=service.name,telemetry.sdk.language")
  32. }
  33. }