Does anyone have code to detect duplicate JARs in the classpath?
Background: When there are two versions of the same JAR in the classpath, really strange things can happen. This can even happen when using tools like Maven: Change a dependency and build the WAR without cleaning first. Since target/webapp/WEB-INF/lib wasn’t cleaned, the dependency will be in there twice.
Is there a safety-net for this?
JBoss Tattletale might help you with this.
It’s a free tool which scans the JAR files used by your project and gives you a report about them.
Amongst its feature are: