apply from: "$rootDir/gradle/instrumentation.gradle"

muzzle {
  pass {
    group = "log4j"
    module = "log4j"
    versions = "[1.2,)"
    skipVersions += '1.2.15' //for some reason only this version depends on jms jar which is not found in MavenCentral
  }
}

dependencies {
  // 1.2 introduces MDC and there's no version earlier than 1.2.4 available
  library group: 'log4j', name: 'log4j', version: '1.2.4'
}

configurations {
  // In order to test the real log4j library we need to remove the log4j transitive
  // dependency 'log4j-over-slf4j' brought in by :testing-common which would shadow
  // the log4j module under test using a proxy to slf4j instead.
  testImplementation.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'

  // See: https://stackoverflow.com/a/9047963/2749853
  testImplementation.exclude group: 'javax.jms', module: 'jms'
}