You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Robert Metzger <rm...@apache.org> on 2020/07/03 08:10:04 UTC

Re: Build behavior differences between 3.2.5 and 3.3.9 with dependency shading

Hi all,

sorry for bringing up this very old thread again: The Flink project is
still using Maven 3.2.5 to have the shading behave as we need it. Using
such an old Maven version has some issues in our development workflow, as
the http library is quite outdated, and developers are working with much
newer maven versions locally, leading to some inconsistent dependency
resolutions.

I was wondering if there was any progress in the last years, so that we can
switch to a newer Maven version?

On Mon, Nov 7, 2016 at 12:04 AM Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> yes that was the advice I gave on this thread originally. you do have to
> fight a bit with the shade plugin to get them shaded in though... which is
> why I think we may need to rethink how we do shade
>
> On 6 November 2016 at 22:36, Jörg Schaible <jo...@gmx.de> wrote:
>
> > Stephen Connolly wrote:
> >
> > > Hmmm I did some digging...
> > >
> > >
> > https://maven.apache.org/ref/3.2.3/apidocs/org/apache/
> > maven/artifact/handler/ArtifactHandler.html#isIncludesDependencies()
> > > is i think the idea JvZ was hinting at.
> > >
> > > For the case where a shaded JAR shades *everything* then a custom
> > > packaging will work as we could set this flag and it would stop the
> > > transitive dependencies being propagated... but most people do not
> shade
> > > *all* dependencies, rather they shade a subset.
> > >
> > > I think we may need to re-think how we do this or rethink the model
> being
> > > read-only
> >
> > Set the shaded dependencies as optional. This might at least technically
> > produce the proper dependency tree for dependent artifacts.
> >
> > Cheers,
> > Jörg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Build behavior differences between 3.2.5 and 3.3.9 with dependency shading

Posted by Robert Metzger <rm...@apache.org>.
Hi Stephen,

Thanks for the offer, I'll try to make sure we return the favor.

Building the current Flink master with a current maven version (3.6.3 on my
machine), leads to the distribution
(in flink/build-target/lib/flink-dist_2.11-1.12-SNAPSHOT.jar) containing
"org/jboss/netty/util" classes.
Building the same code with maven 3.2.5, the distribution will only contain
"org/apache/flink/shaded/akka/org/jboss/netty/util".

The shading is defined here:
https://github.com/apache/flink/blob/master/flink-runtime/pom.xml#L560

We would like to build Flink using current maven versions :)

Regards,
Robert

On Mon, Jul 6, 2020 at 8:43 PM Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> You can make Maven do the right thing if you scope the shades dependencies
> correctly... but it’s a pain.
>
> Can you point me to one pom that’s a good example. I might be able to give
> some pointers in return for a bugfix :rofl:
>
> On Fri 3 Jul 2020 at 09:10, Robert Metzger <rm...@apache.org> wrote:
>
> > Hi all,
> >
> > sorry for bringing up this very old thread again: The Flink project is
> > still using Maven 3.2.5 to have the shading behave as we need it. Using
> > such an old Maven version has some issues in our development workflow, as
> > the http library is quite outdated, and developers are working with much
> > newer maven versions locally, leading to some inconsistent dependency
> > resolutions.
> >
> > I was wondering if there was any progress in the last years, so that we
> can
> > switch to a newer Maven version?
> >
> > On Mon, Nov 7, 2016 at 12:04 AM Stephen Connolly <
> > stephen.alan.connolly@gmail.com> wrote:
> >
> > > yes that was the advice I gave on this thread originally. you do have
> to
> > > fight a bit with the shade plugin to get them shaded in though... which
> > is
> > > why I think we may need to rethink how we do shade
> > >
> > > On 6 November 2016 at 22:36, Jörg Schaible <jo...@gmx.de>
> > wrote:
> > >
> > > > Stephen Connolly wrote:
> > > >
> > > > > Hmmm I did some digging...
> > > > >
> > > > >
> > > > https://maven.apache.org/ref/3.2.3/apidocs/org/apache/
> > > > maven/artifact/handler/ArtifactHandler.html#isIncludesDependencies()
> > > > > is i think the idea JvZ was hinting at.
> > > > >
> > > > > For the case where a shaded JAR shades *everything* then a custom
> > > > > packaging will work as we could set this flag and it would stop the
> > > > > transitive dependencies being propagated... but most people do not
> > > shade
> > > > > *all* dependencies, rather they shade a subset.
> > > > >
> > > > > I think we may need to re-think how we do this or rethink the model
> > > being
> > > > > read-only
> > > >
> > > > Set the shaded dependencies as optional. This might at least
> > technically
> > > > produce the proper dependency tree for dependent artifacts.
> > > >
> > > > Cheers,
> > > > Jörg
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
> --
> Sent from my phone
>

Re: Build behavior differences between 3.2.5 and 3.3.9 with dependency shading

Posted by Stephen Connolly <st...@gmail.com>.
You can make Maven do the right thing if you scope the shades dependencies
correctly... but it’s a pain.

Can you point me to one pom that’s a good example. I might be able to give
some pointers in return for a bugfix :rofl:

On Fri 3 Jul 2020 at 09:10, Robert Metzger <rm...@apache.org> wrote:

> Hi all,
>
> sorry for bringing up this very old thread again: The Flink project is
> still using Maven 3.2.5 to have the shading behave as we need it. Using
> such an old Maven version has some issues in our development workflow, as
> the http library is quite outdated, and developers are working with much
> newer maven versions locally, leading to some inconsistent dependency
> resolutions.
>
> I was wondering if there was any progress in the last years, so that we can
> switch to a newer Maven version?
>
> On Mon, Nov 7, 2016 at 12:04 AM Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
> > yes that was the advice I gave on this thread originally. you do have to
> > fight a bit with the shade plugin to get them shaded in though... which
> is
> > why I think we may need to rethink how we do shade
> >
> > On 6 November 2016 at 22:36, Jörg Schaible <jo...@gmx.de>
> wrote:
> >
> > > Stephen Connolly wrote:
> > >
> > > > Hmmm I did some digging...
> > > >
> > > >
> > > https://maven.apache.org/ref/3.2.3/apidocs/org/apache/
> > > maven/artifact/handler/ArtifactHandler.html#isIncludesDependencies()
> > > > is i think the idea JvZ was hinting at.
> > > >
> > > > For the case where a shaded JAR shades *everything* then a custom
> > > > packaging will work as we could set this flag and it would stop the
> > > > transitive dependencies being propagated... but most people do not
> > shade
> > > > *all* dependencies, rather they shade a subset.
> > > >
> > > > I think we may need to re-think how we do this or rethink the model
> > being
> > > > read-only
> > >
> > > Set the shaded dependencies as optional. This might at least
> technically
> > > produce the proper dependency tree for dependent artifacts.
> > >
> > > Cheers,
> > > Jörg
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
-- 
Sent from my phone