1
0
mirror of synced 2026-05-22 21:33:16 +00:00

SEC-2542: Use exclusions to remove duplicate dependencies

A number of projects had duplicate dependencies on their classpaths
as a result of the same classes being available in more than one
artifact, each with different Maven coordinates. Typically this only
affected the tests, but meant that the actual classes that were
loaded was somewhat unpredictable and had the potential to vary
between an IDE and the command line depending on the order in which
the aritfacts appeared on the classpath. This commit adds a number of
exclusions to remove such duplicates.

In addition to the new exclusions, notable other changes are:

 - Spring Data JPA has been updated to 1.4.1. This brings its
   transitive dependency upon spring-data-commons into line with
   Spring LDAP's and prevents both spring-data-commons-core and
   spring-data-commons from being on the classpath
 - All Servlet API dependencies have been updated to use the official
   artifact with all transitive dependencies on unofficial servlet API
   artifacts being excluded.
 - In places, groovy has been replaced with groovy-all. This removes
   some duplicates caused by groovy's transitive dependencies.
 - JUnit has been updated to 4.11 which brings its transitive Hamcrest
   dependency into line with other components.

There appears to be a bug in Gradle which means that some exclusions
applied to an artifact do not work reliably. To work around this
problem it has been necessary to apply some exclusions at the
configuration level

Conflicts:
	samples/messages-jc/pom.xml
This commit is contained in:
Rob Winch
2014-04-02 08:48:55 -05:00
parent 71ba977dad
commit 3118e39de8
58 changed files with 887 additions and 120 deletions
+13 -7
View File
@@ -117,15 +117,15 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>7.0.33</version>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -143,7 +143,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -175,6 +175,12 @@
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-dep</artifactId>
<groupId>junit</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
+7 -4
View File
@@ -11,11 +11,14 @@ dependencies {
"org.springframework:spring-expression:$springVersion",
"org.springframework:spring-web:$springVersion"
provided 'javax.servlet:jsp-api:2.0',
"org.apache.tomcat:tomcat-servlet-api:$servletApiVersion"
provided 'javax.servlet.jsp:javax.servlet.jsp-api:2.2.1',
"javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion",
"org.spockframework:spock-core:$spockVersion"
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group:'junit', module:'junit-dep'
}
testRuntime "javax.servlet:jstl:$jstlVersion"
}