diff --git a/build.gradle b/build.gradle index 79b9f610ac..e0940410b6 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ configure(allprojects) { project -> ext.rxjavaVersion = "1.3.4" ext.rxjavaAdapterVersion = "1.2.1" ext.rxjava2Version = "2.1.8" - ext.slf4jVersion = "1.7.25" + ext.slf4jVersion = "1.7.25" // spring-jcl + consistent 3rd party deps ext.tiles3Version = "3.0.8" ext.tomcatVersion = "8.5.27" ext.undertowVersion = "1.4.22.Final" @@ -89,6 +89,15 @@ configure(allprojects) { project -> configurations.all { // Check for updates every build resolutionStrategy.cacheChangingModulesFor 0, 'seconds' + + // Consistent slf4j version (e.g. clashes between slf4j versions) + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if (details.requested.group == 'org.slf4j') { + details.useVersion slf4jVersion + } + } + + exclude group: "org.slf4j", module: "jcl-over-slf4j" } def commonCompilerArgs = @@ -149,6 +158,8 @@ configure(allprojects) { project -> testCompile("org.hamcrest:hamcrest-all:1.3") testCompile("org.xmlunit:xmlunit-matchers:2.3.0") testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}") + testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}") + testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") // JSR-305 only used for non-required meta-annotations compileOnly("com.google.code.findbugs:jsr305:3.0.2") testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") diff --git a/spring-context-support/spring-context-support.gradle b/spring-context-support/spring-context-support.gradle index 4d3f77ad25..5d69d2845a 100644 --- a/spring-context-support/spring-context-support.gradle +++ b/spring-context-support/spring-context-support.gradle @@ -16,7 +16,6 @@ dependencies { optional("org.freemarker:freemarker:${freemarkerVersion}") testCompile(project(":spring-context")) testCompile("org.hsqldb:hsqldb:${hsqldbVersion}") - testCompile("org.slf4j:slf4j-api:${slf4jVersion}") testCompile("org.hibernate:hibernate-validator:6.0.7.Final") testRuntime("org.ehcache:jcache:1.0.1") testRuntime("org.ehcache:ehcache:3.4.0") diff --git a/spring-context/spring-context.gradle b/spring-context/spring-context.gradle index 135ff77b0c..915ce71202 100644 --- a/spring-context/spring-context.gradle +++ b/spring-context/spring-context.gradle @@ -24,7 +24,6 @@ dependencies { optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}") testCompile("org.apache.commons:commons-pool2:2.5.0") - testCompile("org.slf4j:slf4j-api:${slf4jVersion}") testCompile("javax.inject:javax.inject-tck:1") testRuntime("javax.xml.bind:jaxb-api:2.3.0") testRuntime("org.glassfish:javax.el:3.0.1-b08") diff --git a/spring-test/spring-test.gradle b/spring-test/spring-test.gradle index 3eab98c336..36c5a4870c 100644 --- a/spring-test/spring-test.gradle +++ b/spring-test/spring-test.gradle @@ -74,12 +74,8 @@ dependencies { testCompile("com.thoughtworks.xstream:xstream:1.4.10") testCompile("com.rometools:rome:1.9.0") testCompile("org.apache.tiles:tiles-api:${tiles3Version}") - testCompile("org.apache.tiles:tiles-core:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } - testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } + testCompile("org.apache.tiles:tiles-core:${tiles3Version}") + testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") testCompile("org.hsqldb:hsqldb:${hsqldbVersion}") testCompile("org.apache.httpcomponents:httpclient:4.5.5") { exclude group: "commons-logging", module: "commons-logging" @@ -91,7 +87,6 @@ dependencies { testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") testCompile('de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1') - testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") // Java Util Logging for JUnit 5 testRuntime("javax.annotation:javax.annotation-api:1.3.1") testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("com.sun.xml.bind:jaxb-core:2.3.0") diff --git a/spring-webmvc/spring-webmvc.gradle b/spring-webmvc/spring-webmvc.gradle index 0ae253bde0..e5e02184c8 100644 --- a/spring-webmvc/spring-webmvc.gradle +++ b/spring-webmvc/spring-webmvc.gradle @@ -36,20 +36,11 @@ dependencies { optional("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson2Version}") optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jackson2Version}") optional("org.apache.tiles:tiles-api:${tiles3Version}") - optional("org.apache.tiles:tiles-core:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } - optional("org.apache.tiles:tiles-servlet:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } - optional("org.apache.tiles:tiles-jsp:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } - optional("org.apache.tiles:tiles-el:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" - } + optional("org.apache.tiles:tiles-core:${tiles3Version}") + optional("org.apache.tiles:tiles-servlet:${tiles3Version}") + optional("org.apache.tiles:tiles-jsp:${tiles3Version}") + optional("org.apache.tiles:tiles-el:${tiles3Version}") optional("org.apache.tiles:tiles-extras:${tiles3Version}") { - exclude group: "org.slf4j", module: "jcl-over-slf4j" exclude group: "org.springframework", module: "spring-web" } optional("org.codehaus.groovy:groovy-all:${groovyVersion}")