[
https://issues.apache.org/jira/browse/MNG-5899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15990345#comment-15990345
]
ASF GitHub Bot commented on MNG-5899:
-------------------------------------
Github user stephenc commented on the issue:
https://github.com/apache/maven/pull/69
> If the shaded artifact is built as a submodule with a different artifact
> ID, then the shade plugin can specify its DRP as its main POM. It lets
> other projects depend on the shaded artifact with only its remaining
> (unshaded) dependencies.
There are issues with that:
1. There can be issues with a clean build with an empty repository for some
reactors (because there is no information to let maven know the
shadedArtifactId will be produced by artifactId so in some cases Maven will
fail the build early because it "knows" there is no such artifact. Typically
this happens in larger reactors where the build sequence can be more
"unpredictable" and Maven decides that there is a "short-cut"
2. There can be issues with a build from a non-empty repository, especially
when using `-rf`, as you can end up using the `-SNAPSHOT` from a previous
execution (which may retain bugs).
My original proposal for a solution was to allow a plugin to advertise
dependency reduction of a pom (or additional GAV production).
For dependency reduction, Maven would enforce specific rules such as "no
new dependencies" and the build plan would be unmodified.
For additional GAV production, there would have to be strict rules on the
new GAV (such as being evaluated based entirely on properties available to
general project GAV computation - i.e. nothing injected into the build by
another plugin) and similar rules on the new GAV pom (i.e. only ever a subset
of the GAV it is being generated from)
That would allow us to create the build plan reflecting the potential
behaviours of the shade plugin (as well as the flatten plugin) before any
plugin executions but allow plugins to do what is necessary... but my
suggestion was shot down last time
> Reactor is no longer using the dependency reduced pom created by
> maven-shade-plugin
> -----------------------------------------------------------------------------------
>
> Key: MNG-5899
> URL: https://issues.apache.org/jira/browse/MNG-5899
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.3.1, 3.3.3
> Reporter: Trask Stalnaker
>
> This works with maven 3.2.5 and prior, but does not work with the latest
> releases (3.3.1 and 3.3.3), or master (tested against 3.3.7-SNAPSHOT).
> I did some bisecting and found the commit that caused the breakage:
> https://github.com/apache/maven/commit/be3fb200326208ca4b8c41ebf16d5ae6b8049792
> In particular, this commit introduced some code to not rebuild the model if
> it was already loaded during reactor resolution.
> This is causing maven not to use the dependency reduced pom created by the
> maven-shade-plugin.
> Removing this code fixes the situation. I'm hoping that code was just
> introduced as a performance optimization, and that I haven't broken anything
> functionally by removing it (the tests still pass at least).
> I will submit a pull request with the change for review.
> Here is the original maven-shade-plugin issue as reported by the Apache Storm
> team: https://issues.apache.org/jira/browse/MSHADE-206
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)