A maven shade plugin that adds the dependent-reduced-pom.xml to the base directory

The maven shade plugin creates a file called dependency-reduced-pom.xml as well as artifactname-shaded.jar and places them in the base directory.

This is mistake? Must be in the destination directory. Any workaround?

+46
java maven maven-shade-plugin
Jul 03 2018-12-12T00:
source share
5 answers

You can avoid creating it by setting createDependencyReducedPom to false.

eg.

 <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 apache for more details .

enter image description here

+48
Jul 04 2018-12-12T00:
source share

Based on bmargulies ' answer and his comments on xv. , I decided to configure POM with dependency reduction that will be output to target/ , which is already ignored in my VCS.

To do this, I simply added the dependencyReducedPomLocation element to the plugin's configuration element, i.e.

 <configuration> <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation> (...) </configuration> 
+19
Oct. 16 '14 at 1:57
source share

See https://issues.apache.org/jira/browse/MSHADE-121 , as well as https://issues.apache.org/jira/browse/MSHADE-124 .

It is possible to move drp to another place, but you may not like the consequences.

You are mistaken in the fact that in the bank with shading it always hits the target / if you have not moved it to another place.

+7
Jul 03 '12 at 15:33
source share

You can use the old version of the plugin. Version 1.7 of the maven-shade plugin writes to / target.

Starting with version 1.7.1, pom.xml, depending on dependencies, is written based on. See Question MSHADE-124 for some reasons why this was done and what are the implications. If you try to set dependencyReducedPomLocation, you will most likely run into problems creating the site - an open MSHADE-145 problem.

+3
Oct. 16 '14 at 16:46
source share

The documentation at http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html is incorrect when it says:

createDependencyReducedPom boolean - specify whether to generate a simplified POM for a shaded artifact. If set to true, the dependencies that were included in the uber JAR will be removed from the POM generated section. The abbreviated POM will be named dependency-reduced-pom.xml and stored in the same directory as the shaded artifact. If you do not specify dependencyReducedPomLocation, the plugin will create a temporary file named dependency-reduced-pom.xml in the basedir project. The default value is: true.

dependent-reduced-pom.xml is not saved in the same directory as the shaded artifact (destination directory) ... it is actually generated in the base directory, not the target

+1
Sep 18 '14 at 15:57
source share



All Articles