There are two solutions. 1. Use Maven < 3.3.0 2. Mark the dependencies that are shaded as optional or provided in the module doing the shading
In the transition from Maven 3.2.x to Maven 3.3.x the internal model was made read-only which rendered the hacks that the shade plugin has been using (to remove shaded dependencies) invalid. Consequently, until JvZ proves that a custom packaging for shaded jars can achieve the same effective result with a read-only model, you are left with this issue when using a shaded jar *that is built in the same reactor* On 6 November 2016 at 05:35, Reminia Scarlet <[email protected]> wrote: > Hi all: > > I have a project with two modules as below: > > project > -- module1 (shaded jar) > -- module2 (war) > > Module2 depends on module1. And module1 packages to a shaded jar with maven > shade plugin. Module2 packages to a war which depends on module1. > > When I try to execute mvn package, it produces a war contains the shaded > jar but also the dependent libs which the shades jar depends. > > That's strange. How can I make the war contain shaded jar only but not the > dependent libs? Any advice, thanks. >
