Question

I'm trying to build a war file to be deployed to a tomcat server using Maven, but have noticed some strange behaviour when building my war file:

When running the command from project folder: mvn clean compile package -DskipTests

  • Maven version 3.0 produces a war file 12.079MB (49 jar files in WEB-INF/lib folder)
  • Maven version 3.0 beta1 produces a war file 8.7MB (31 jar files in WEB-INF/lib folder)
  • Maven version 2.11 produces a war file 2.3MB (3 jar files in WEB-INF/lib folder)

What can be causing the extra jar files to be included in the project? Presumably they are not needed as building the project using version 2.11 has worked fine in the past.

Was it helpful?

Solution

I had something similar happen to me. Here's what happened.

In Maven 2.x the plugin versions are set by Maven itself. In Maven 3.x it will use the "latest" and give you a warning. In my case, using a later version of the compiler plugin caused some differences and a later version of the dependency plugin cause other differences.

Once I explicitly set all the versions of all plugins in my pom.xml (a best practice anyway), the inconsistencies went away.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top