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: Build behavior differences between 3.2.5 and 3.3.9 with dependency shading
Date Thu, 10 Dec 2015 16:01:00 GMT
You need to do this in any module that is producing a dependency reduced
pom (and only in those modules)

You can leave the version being inherited from dependencyManagement.

I advise using the optional technique until Jason gets a new packaging for
dependency reduced artifacts (or decides to agree with my suggestion of
limited ability to modify the model after the reactor has been constructed)

The 3.2 behaviour is currently viewed as a bug that has been abused by the
shade plugin rather than a feature. 3.3 enforces the immutability of the
model and I don't see that being rolled back

On Thursday 10 December 2015, Robert Metzger <rmetzger@apache.org> wrote:

> Okay, the <optional>true</> suggestion sounds interesting. I'll try that
> out.
>
> However, I'm still wondering why the behavior between 3.2 and 3.3 is
> different?
> Our CI system runs Maven 3.2, so the shading is done correctly there. If a
> project committer now adds a guava dependency and forgets the <optional>,
> we end up with guava in our final fat jar for users building with 3.3.
> Putting guava with optional=true into our dependency management is not an
> option because that would overwrite Hadoop's guava version (we shade hadoop
> and its guava in our project as well)
>
>
>
> On Thu, Dec 10, 2015 at 2:08 PM, Stephen Connolly <
> stephen.alan.connolly@gmail.com <javascript:;>> wrote:
>
> > Dependency reduced poms require mutation of the model after the build
> > started. JvZ is investigating a different packaging type to resolve
> this...
> > Workaround for now is to mark all the dependencies that are removed as
> > <optional>true</optional> so that they are no longer transitive and
that
> > way the effective reactor Pom is the same from a transitive dependency
> PoV
> > as the dependency reduced one that gets published
> >
> > On Thursday 10 December 2015, Robert Metzger <rmetzger@apache.org
> <javascript:;>> wrote:
> >
> > > Hi,
> > >
> > > The Apache Flink project is using Maven for dependency management. We
> > shade
> > > Google's Guava away (to org.apache.flink.shaded.com.google.commons) to
> > > avoid conflicts with user guava versions.
> > >
> > > Building Flink with Maven 3.2.5 will create a valid fat-jar without
> > guava.
> > > However, Maven 3.3.9 (and other 3.3.x versions) are including guava in
> > the
> > > com/google/commons namespace.
> > > Interestingly, doing only a "clean install" in the "flink-dist" package
> > > after a build of the parent pom results in a correct "flink-dist" fat
> > jar.
> > >
> > > I'm wondering which behavior of Maven is correct 3.2 or 3.3 ?
> > > I have the feeling that 3.3 is behaving incorrectly because the
> > > dependency:tree of "flink-dist" does not contain Guava.
> > > Maybe a "clean install" on the parent pom with Maven 3.3 is not
> > respecting
> > > the dependency-reduced poms created by the other modules?
> > >
> > > Regards,
> > > Robert
> > >
> >
> >
> > --
> > Sent from my phone
> >
>


-- 
Sent from my phone

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