build.gradle.kts 1.1 KB

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