title: How to detect duplicate JARs in the classpath?
body: <p>Does anyone have code to detect duplicate JARs in the classpath?</p>
  
  <p>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 <code>target/webapp/WEB-INF/lib</code> wasn't cleaned, the dependency will be in there twice.</p>
  
  <p>Is there a safety-net for this?</p>