maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: package a war which depends on a shaded jar or at jar
Date Sun, 06 Nov 2016 21:44:14 GMT
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 <reminia.scarlet@gmail.com>
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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message