Maven 2.x Shade Plugin

Please allow binding to pre-package

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.2.2
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
  • Number of attachments :
    1

Description

for whatever reason, the shade plugin tries to add my target/classes directory to the list of zip files:

Embedded error: error in opening zip file/home/.../workspace/project/target/classes

which fails because it is a directory. Instead, it should use the normal file inclusion.

This issue may or may not be related to #MSHADE-60 and #MSHADE-65

Issue Links

Activity

Hide
Max Berger added a comment -

The issue is invalid - I tried to bind the shade-plugin to the prepare-package phase instead of the package phase.

So please change the topic to: [Wish] support attaching to prepare-package phase.

Show
Max Berger added a comment - The issue is invalid - I tried to bind the shade-plugin to the prepare-package phase instead of the package phase. So please change the topic to: [Wish] support attaching to prepare-package phase.
Hide
Yoann Yonnet added a comment -

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 run successfully and install resulting jar file in the maven local repository.
The second module build fail with this error : error in opening zip /home/.../target/classes.
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

Show
Yoann Yonnet added a comment - 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 run successfully and install resulting jar file in the maven local repository. The second module build fail with this error : error in opening zip /home/.../target/classes. 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
Hide
Robert Burrell Donkin added a comment -

Having read the comments, I think that this substance of this issue is in the way that shade interacts with multimodule projects. Probably worthwhile consolidating into a single issue.

Show
Robert Burrell Donkin added a comment - Having read the comments, I think that this substance of this issue is in the way that shade interacts with multimodule projects. Probably worthwhile consolidating into a single issue.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: