This post is possibly related to https://www.genuitec.com/forums/topic/duplicate-jar-files-in-web-inf-lib/
For web-projects (either created with the Web Project wizard or imported), duplicate jars (same groupid/artifactid, diff version) in WEB-INF/lib seem to occur with “Resolve dependencies from Workspace project” and a dependent project has a different version of the same artifact.
After closing the dependent projects or disabling “Resolve dependencies from Workspace project”, the correct jars are copied WEB-INF/lib.
Steps to reproduce:
# Create a web-app using the “Web Project” wizard with maven support.
# Remove all dependencies from the web-app.
# Add a dependency:
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
# Delete /src/WebRoot/WEB-INF/lib/
# Create a java maven project
# Remove all dependencies from the 2nd project.
# Add a dependency with same groupid/artifactid, diff version:
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.3</version>
</dependency>
# Add the 2nd project as a dependency in the web-app
# Deploy the web-app to a server.
–> 2 commons-lang jars in …/server/[web-app]/WEB-INF/lib/