Menu
  • HOME
  • TAGS

Obtain multiple maven dependency trees

maven,maven-3,maven-dependency-plugin

There is no plugin that does exactly that, but there is a plugin that can help deal with the nearest-win maven dependency resolution strategy, and protect against it's occasionally unintended consequences. It's the maven enforcer plugin, that with it's dependencyConvergence rule basically turns off the maven nearest-win strategy. With that...

List all the modules of an aggregate POM dependent on a specific dependency

maven,maven-plugin,maven-dependency-plugin

Since the modules were right under the aggregator, I merely used grep on the pom.xmls to list them. Sometimes, simplicity helps ;)

Output from maven dependency:tree, which version will override

maven,maven-dependency-plugin

From the documentation: "By Default Maven will solve conflicts with a nearest-win approach" [Resolving Conflicts]. This translates to picking org.apache.kafka:kafka_2.11:jar:0.8.2-V3-PATCH:compile in your example. Also see Transitive Dependencies The nearest-win approach just picks the version of the dependency closest to the left in the Maven dependency tree output. This approach chooses...

Customize dependency file names in maven

java,maven,jar,maven-dependency-plugin

I was able to achieve this using "prependGroupId" parameter. Sample configuration snippet: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <prependGroupId>true</prependGroupId>...

In maven-dependency-plugin how to unpack only if I pass him parameter?

maven,pom.xml,maven-dependency-plugin

So I figured it out, You simply have to put the skip flag in the right place, I've put it right after the configuration. <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <executions> <execution> <id>get-rpm</id> <phase>compile</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems>...

maven-dependency-plugin:unpack Error

maven-3,maven-dependency-plugin

The issue is due to you cannot use mvn clean compile dependency:unpack and <executions> tags together. In documentation Maven Depdendency Plugin at the bottom part of the page you can read: If you intend to configure this mojo for execution on the command line using: mvn dependency:unpack you must not...

“Failed to read artifact descriptor” when compiling maven-dependency-plugin:

maven,maven-3,maven-dependency-plugin

The parent pom can be found in maven central. So it should be enough to simple remove the <relativePath> statement from the <parent>. Sometimes an empty <relativePath /> also helps to tell maven to resolve the pom from the repository and not try to find it via a relative path...

Is there an equivalent of maven's copy-dependency that copies plugins?

maven,maven-dependency-plugin

There is no such plugin. But you can just delete your local Maven repository, execute the Maven build and then copy the contents of the local repository, where you can find all plugins and dependencies for your build.

Do not reproduce path during maven-dependency-plugin unpack goal

maven,maven-3,unpack,maven-dependency-plugin

You can use the Jetspeed unpack maven plugin: http://pulkitsinghal.blogspot.be/2011/04/jetspeed-finally-unpack-plugin-with.html See http://portals.apache.org/jetspeed-2/buildguide/jetspeed-unpack-plugin.html for documentation. The option you want is : <flat>true</flat> Full example: <plugin> <groupId>org.apache.portals.jetspeed-2</groupId> <artifactId>jetspeed-unpack-maven-plugin</artifactId> <version>${org.apache.portals.jetspeed.version}</version>...