On 9 Jun 2009, at 22:00, James Adams wrote:
I am building my JAR file using the shade plugin in order to give me
an
all-in-one JAR artifact which contains all dependency JARs. When I
build
using "mvn clean install" I always get thousands of message like the
following, indicating that there's a duplicate class file in a JAR
in the
repository, which I assume is coming from the shade plugin when it's
doing
its thing:
[WARNING] We have a duplicate
net/sf/cglib/util/StringSwitcher$StringSwitcherKey.class in
C:\dev\maven\repository\cglib\cglib-full\2.0.2\cglib-full-2.0.2.jar
Is this something I should worry about or is it just an annoyance to
live
with for now? The resulting JAR artifact works well, maybe this is
nothing
to worry over, but I want to ask here in case there is something I
can fix
which will make these warning messages go away. I can't find
anything about
this using Google, etc.
I ran into this with different variations of commons-logging. There's
commons-logging (the full jar) and commons-logging-api (JDK14 logging
only). But they contain some of the same classes even though they're
different artifacts. Different dependencies were pulling in different
versions of the same class.
In this case, I used a dependencyManagement section to exclude commons-
logging-api. But this isn't a general solution. You might not be
able to exclude the jar that contains duplicates.
That said, the warnings are ignorable.
-Dom
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]