build.gradle.kts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. compileOnly(project(":javaagent-bootstrap"))
  17. testImplementation("org.awaitility:awaitility")
  18. }
  19. configurations {
  20. // In order to test the real log4j library we need to remove the log4j transitive
  21. // dependency 'log4j-over-slf4j' brought in by :testing-common which would shadow
  22. // the log4j module under test using a proxy to slf4j instead.
  23. testImplementation {
  24. exclude("org.slf4j", "log4j-over-slf4j")
  25. }
  26. }
  27. tasks.withType<Test>().configureEach {
  28. // TODO run tests both with and without experimental log attributes
  29. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental.capture-mdc-attributes=*")
  30. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental-log-attributes=true")
  31. }