[ http://jira.codehaus.org/browse/MSHADE-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144915#action_144915 ]
Johannes Zillmann commented on MSHADE-30: ----------------------------------------- Have the same problem in a multiproject setup. Project A contains submodule B. B's pom.xml contains the shade setup (like the example). Now from A i execute: {noformat} mvn clean package install -Dmaven.test.skip -o {noformat} That gives me: {noformat} [jar:jar] [INFO] [shade:shade {execution: default}] [INFO] Including commons-cli:commons-cli:jar:1.1 in the shaded jar. [INFO] Excluding log4j:log4j:jar:1.2.13 from the shaded jar. [INFO] Excluding org.apache.maven:maven-script-ant:jar:2.0.1 from the shaded jar. [INFO] Excluding org.apache.maven:maven-plugin-api:jar:2.0.1 from the shaded jar. [INFO] Excluding org.codehaus.plexus:plexus-ant-factory:jar:1.0-alpha-1 from the shaded jar. [INFO] Excluding ant:ant-launcher:jar:1.6.5 from the shaded jar. [INFO] Excluding ant:ant:jar:1.6.5 from the shaded jar. [INFO] Excluding org.codehaus.plexus:plexus-utils:jar:1.0.5 from the shaded jar. [INFO] Excluding classworlds:classworlds:jar:1.1-alpha-2 from the shaded jar. [INFO] Excluding org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8 from the shaded jar. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error creating shaded jar. Embedded error: duplicate entry: org/apache/commons/cli/AlreadySelectedException.class [INFO] ------------------------------------------------------------------------ [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Error creating shaded jar. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar. at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:327) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) ... 16 more Caused by: java.util.zip.ZipException: duplicate entry: org/apache/commons/cli/AlreadySelectedException.class at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:163) at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:90) at org.apache.maven.plugins.shade.DefaultShader.addRemappedClass(DefaultShader.java:182) at org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:104) at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:285) ... 18 more {noformat} > duplicate entry error > --------------------- > > Key: MSHADE-30 > URL: http://jira.codehaus.org/browse/MSHADE-30 > Project: Maven 2.x Shade Plugin > Issue Type: Bug > Affects Versions: 1.0.1 > Reporter: Michael Mattox > > I receive this error: > Embedded error: duplicate entry: org/apache/xmlbeans/FilterXmlObject.class > It started with a javax.xml.namespace class. So I started putting excludes, > and then I kept getting one new class after another. If I exclude everything > then I doubt my application is going to work. > I really don't understand this error. I have never seen this type of error > with the fatjar eclipse plugin. I understand it's complaining about having > the same class twice, but if it's not a problem for my eclipse project or the > maven build, why is it a problem for shade? > I feel the shade plugin should be able to handle this gracefully. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira