Maven shade plugin adding dependency-reduced-pom.xml to base directory

Based on bmargulies' answer and his comment on Xv.'s answer, I decided to configure the dependency-reduced POM to be output to target/, which is already ignored in my VCS.

To do that, I just added the dependencyReducedPomLocation element to the configuration element of the plugin, i.e.

<configuration>
  <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
  (...)
</configuration>

See https://issues.apache.org/jira/browse/MSHADE-121, and also https://issues.apache.org/jira/browse/MSHADE-124.

There is an option to move the d-r-p to elsewhere, but you may not like the consequences.

You are wrong about the -shaded jar, it always ends up in target/ unless you move it elsewhere.


You can avoid having it created by setting createDependencyReducedPom to false.

e.g.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>${maven-shade-plugin.version}</version>
    <configuration>
        <createDependencyReducedPom>false</createDependencyReducedPom>
    </configuration>
    ....
    ....
</plugin>

See more detail from apache

enter image description here