Issue
I am using Maven to build a WAR file with the following parameters: mvn clean package
This builds successfully but when I open up the WAR I see the following:
jackson-core-2.2.3.jar
jackson-core-2.3.0.jar
pushy-0.2.jar
pushy-0.3.jar
This causes problems on our application server (Most likely conflicts), I proved this by manually deleting the old dependencies in the WAR which fixes any issues.
I have checked the Dependency Hierarchy view in Eclipse and I don't see versions 2.2.3 of Jackson or 0.2 of Pushy listed anywhere.
I have also tried deleting my whole .m2 repository but this doesn't seem to have made any difference.
Is there any particular reason why Maven would be including these old JARs?
Pom.xml dependencies:
<dependencies>
<dependency>
<groupId>core</groupId>
<artifactId>core</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.threewks.thundr</groupId>
<artifactId>thundr-mailgun</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.18.1</version>
</dependency>
</dependencies>
Core.jar pom.xml depdencies:
<dependencies>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.facebook4j</groupId>
<artifactId>facebook4j-core</artifactId>
<version>[2.0,)</version>
</dependency>
<dependency>
<groupId>com.relayrides</groupId>
<artifactId>pushy</artifactId>
<version>0.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.5.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.threewks.thundr</groupId>
<artifactId>thundr-mailgun</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
Here is the result of running the dependency tree parameter with mvn when building the WAR:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ vimbaserver ---
[INFO] vimbaserver:vimbaserver:war:1.0
[INFO] +- core:core:jar:1.0:compile
[INFO] | +- (commons-dbcp:commons-dbcp:jar:1.4:compile - omitted for duplicate)
[INFO] | +- commons-lang:commons-lang:jar:2.3:compile
[INFO] | +- commons-codec:commons-codec:jar:1.5:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.3.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.0:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.3.0:compile - omitted for duplicate)
[INFO] | +- org.mariadb.jdbc:mariadb-java-client:jar:1.1.7:compile
[INFO] | | +- net.java.dev.jna:jna:jar:3.3.0:compile
[INFO] | | \- net.java.dev.jna:jna:jar:platform:3.3.0:compile
[INFO] | +- junit:junit:jar:4.11:compile
[INFO] | | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.facebook4j:facebook4j-core:jar:2.1.0:compile
[INFO] | +- com.relayrides:pushy:jar:0.3:compile
[INFO] | | +- org.slf4j:slf4j-api:jar:1.7.6:compile
[INFO] | | +- io.netty:netty-all:jar:4.0.18.Final:compile
[INFO] | | \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | | \- (junit:junit:jar:4.10:compile - omitted for conflict with 4.11)
[INFO] | +- (log4j:log4j:jar:1.2.16:compile - omitted for duplicate)
[INFO] | +- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] | | \- (javax.activation:activation:jar:1.1:compile - omitted for conflict with 1.1.1)
[INFO] | +- javax.mail:javax.mail-api:jar:1.5.2:runtime
[INFO] | | \- (javax.activation:activation:jar:1.1:runtime - omitted for duplicate)
[INFO] | +- javax.activation:activation:jar:1.1.1:compile
[INFO] | \- (com.threewks.thundr:thundr-mailgun:jar:1.1.0:compile - omitted for duplicate)
[INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.31:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- com.threewks.thundr:thundr-mailgun:jar:1.1.0:compile
[INFO] | \- com.threewks.thundr:thundr-http:jar:1.1.0:compile
[INFO] | \- com.threewks.thundr:thundr:jar:1.1.0:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] | +- joda-time:joda-time:jar:2.3:compile
[INFO] | +- com.google.code.gson:gson:jar:2.1:compile
[INFO] | +- com.atomicleopard:expressive:jar:0.9.5:compile
[INFO] | +- org.jodd:jodd-bean:jar:3.4.4:compile
[INFO] | | \- org.jodd:jodd-core:jar:3.4.4:compile
[INFO] | +- org.jodd:jodd-proxetta:jar:3.4.4:compile
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted for conflict with 1.7.6)
[INFO] | | \- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | +- org.jodd:jodd-servlet:jar:3.4.4:compile
[INFO] | | +- (org.jodd:jodd-bean:jar:3.4.4:compile - omitted for duplicate)
[INFO] | | +- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | | \- org.jodd:jodd-upload:jar:3.4.4:compile
[INFO] | | \- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | \- org.apache.directory.studio:org.apache.commons.codec:jar:1.6:compile
[INFO] | \- (commons-codec:commons-codec:jar:1.6:compile - omitted for conflict with 1.5)
[INFO] +- com.sun.jersey:jersey-client:jar:1.18.1:compile
[INFO] | \- (com.sun.jersey:jersey-core:jar:1.18.1:compile - omitted for duplicate)
[INFO] +- com.sun.jersey:jersey-core:jar:1.18.1:compile
[INFO] \- com.sun.jersey.contribs:jersey-multipart:jar:1.18.1:compile
[INFO] +- org.jvnet.mimepull:mimepull:jar:1.9.3:compile
[INFO] \- (com.sun.jersey:jersey-core:jar:1.18.1:compile - omitted for duplicate)
Solution
I have encountered this before - please check your WEB-INF/ folder in the jboss directory for old jars.
Answered By - Biscuit128
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)