From 369d77bdf0992d95480a0250d553fadb4c186c7a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 10 Jun 2012 02:33:46 +0200 Subject: [PATCH] spring-test module now depends on junit:junit-dep The junit:junit Maven artifact includes a bundled version of hamcrest core. For projects that depend on later versions of hamcrest this causes significant issues in terms of dependency management. The spring-test module now depends on junit:junit-dep, thus allowing developers to better manage their test dependencies on a more fine grained level. Also tidied up dependency issues regarding hamcrest-core and hamcrest-all across the build. Issue: SPR-6966 --- build.gradle | 20 ++++++++++++++++---- src/dist/changelog.txt | 6 ++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 296af4f03fe..c579c8971dd 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,7 @@ configure(allprojects) { targetCompatibility=1.5 ext.aspectjVersion = '1.6.12' + ext.junitVersion = '4.10' [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none'] @@ -31,9 +32,11 @@ configure(allprojects) { } dependencies { - testCompile "junit:junit:4.10" - testCompile "org.easymock:easymock:2.5.1" + testCompile ("junit:junit-dep:${junitVersion}") { + exclude group: 'org.hamcrest', module: 'hamcrest-core' + } testCompile "org.hamcrest:hamcrest-all:1.1" + testCompile "org.easymock:easymock:2.5.1" } // servlet-api (2.5) and tomcat-servlet-api (3.0) classpath entries should not be @@ -475,8 +478,17 @@ project('spring-test') { compile(project(":spring-web"), optional) compile(project(":spring-webmvc"), optional) compile(project(":spring-webmvc-portlet"), optional) - compile("junit:junit:4.10", optional) - compile("org.testng:testng:6.5.2", optional) + compile("junit:junit-dep:${junitVersion}") { dep -> + optional dep + // We already have hamcrest-all as a global testCompile dependency. + exclude group: 'org.hamcrest', module: 'hamcrest-core' + } + compile("org.testng:testng:6.5.2") { dep -> + optional dep + exclude group: 'junit', module: 'junit' + // We already have hamcrest-all as a global testCompile dependency. + exclude group: 'org.hamcrest', module: 'hamcrest-core' + } compile("javax.servlet:servlet-api:2.5", optional) compile("javax.servlet.jsp:jsp-api:2.1", optional) compile("javax.portlet:portlet-api:2.0", optional) diff --git a/src/dist/changelog.txt b/src/dist/changelog.txt index a7ad6dd599c..0ab263a1071 100644 --- a/src/dist/changelog.txt +++ b/src/dist/changelog.txt @@ -3,6 +3,12 @@ SPRING FRAMEWORK CHANGELOG http://www.springsource.org +Changes in version 3.2 M2 +------------------------- + +* spring-test module now depends on junit:junit-dep + + Changes in version 3.2 M1 (2012-05-28) --------------------------------------