[ https://issues.apache.org/jira/browse/MSHADE-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17517764#comment-17517764 ]
James Z.M. Gao edited comment on MSHADE-323 at 4/6/22 1:05 AM: --------------------------------------------------------------- [~ilyak] this [pr|https://github.com/apache/maven-shade-plugin/pull/129] makes it possible to chain the flatten and shade plugins on rewriting the project pom. This pr does not change the `originalModel`. But imo the root cause of the conflicts should be the inconsistent of `project.getOriginalModel()` and `readModel(project.getFile())`. So every plugin rewriting the pom file should also update original model to reflect the new pom file content, whereas the flatten and shade plugins both lack this step after switching the project pom. NB: The work around of invoking flatten in package phase after the shade plugin does not work when setting `<useDependencyReducedPomInJar>` true in the shade plugin, i.e., the pom in the shaded jar is still not processed by the flatten plugin. was (Author: gzm55): [~ilyak] this [pr|https://github.com/apache/maven-shade-plugin/pull/129] makes it possible to chain the flatten and shade plugins on rewriting the project pom. This pr does not change the `originalModel`. But imo the root cause of the conflicts should be the inconsistent of `project.getOriginalModel()` and `readModel(project.getFile())`. So every plugin rewriting the pom file should also update original model to reflect the new pom file content, whereas the flatten and shade plugins both lack this step after switching the project pom. > Flatten Maven Plugin conflicts with Maven Shade Plugin > ------------------------------------------------------ > > Key: MSHADE-323 > URL: https://issues.apache.org/jira/browse/MSHADE-323 > Project: Maven Shade Plugin > Issue Type: Bug > Reporter: lakunma > Priority: Minor > > When using Flatten Maven Plugin in the same project with Maven Shade Plugin > then the dependency reduced POM is _not_ flattened. > What i encountered that having flatten plugin configured according to > [https://maven.apache.org/maven-ci-friendly.html], and having shade plugin > configured with the default settings to produce uber jar the ${revision} > variable remains and gets installed/deployed within the final pom, thus > making the pom in the repository invalid. > It seems that both plugins transform original pom. And then what gets > installed in the last one, which is the 'shades' one. I'm not sure that's a > bug (in a sense that it is shade's fault). > See also [https://github.com/mojohaus/flatten-maven-plugin/issues/100] -- This message was sent by Atlassian Jira (v8.20.1#820001)