[ 
http://jira.codehaus.org/browse/MSHADE-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=211857#action_211857
 ] 

Stefan Rufer commented on MSHADE-75:
------------------------------------

Similar effect for me, but not exactly as described above: It seems that the 
shade plugin tries to include the target/classes directory of the module for 
which it was started:

sru...@legolas:~/Documents/ws-titrakk/sixtrakk-client-remoting$ mvn clean 
package

[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: 
/home/srufer/Documents/ws-titrakk/sixtrakk-client-remoting/target/sixtrakk-client-1.0.1-SNAPSHOT-nctest.jar
...
[INFO] [shade:shade {execution: default}]
...
[INFO] Including commons-codec:commons-codec:jar:1.2 in the shaded jar.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating shaded jar: error in opening zip file 
/home/srufer/Documents/ws-titrakk/sixtrakk-client-remoting/target/classes

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Fri Feb 26 23:59:57 CET 2010
[INFO] Final Memory: 24M/153M
[INFO] ------------------------------------------------------------------------
sru...@legolas:~/Documents/ws-titrakk/sixtrakk-client-remoting$ 

However, if I comment out the classifier tag of the maven-jar-plugin in my 
pom.xml, it builds the shaded JAR without complaints. Is the shade plugin being 
confused by this?

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
  <!-- 
          <classifier>${env.name}</classifier>
 -->
        </configuration>
      </plugin>

Maven 2.2.1, Java 1.6.0_16, maven-shade-plugin 1.3.1

> Package maven multimodule project with shade plugin : error in opening zip on 
> directory
> ---------------------------------------------------------------------------------------
>
>                 Key: MSHADE-75
>                 URL: http://jira.codehaus.org/browse/MSHADE-75
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Ubuntu 9.04 - Jaunty Jackalope -, Eclispse (Galileo), 
> java 1.6.0_16
>            Reporter: Yoann Yonnet
>         Attachments: patch-maven-shade-plugin.txt
>
>
> Hello,
> I make a maven aggregator project with two modules.
> The first module is a dependency of the second.
> The first module is build with the install goal.
> The second with the shade plugin during the package phase.
> The first module build runs successfully and install resulting jar file in 
> the maven local repository.
> The second module build fails with this error : 
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Error creating shaded jar: error in opening zip file 
> /home/yoann/workspace/maven.1265640716107/trunk/tcx-ws-client/module1/target/classes
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 10 seconds
> [INFO] Finished at: Fri Feb 12 10:39:29 CET 2010
> [INFO] Final Memory: 59M/583M
> [INFO] 
> ------------------------------------------------------------------------
> It's due to the shade plugin whose tries to reference first module classes 
> from target/classes repository instead of the jar file previously build.
> Therefore, it seems that the shade plugin doesn't work with a maven 
> multimodules project.
> I manage to build my maven aggregator project by applying the attached patch 
> (patch-maven-shade-plugin.txt) on the class ShadeMojo.java

-- 
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

        

Reply via email to