Debug-Plugin

Plugin helping developers to debug dependency conflicts

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

de.mytoys.maven.plugins
ArtifactId

ArtifactId

debug-maven-plugin
Last Version

Last Version

1.5
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Debug-Plugin
Plugin helping developers to debug dependency conflicts
Source Code Management

Source Code Management

https://github.com/lenniboy/debug-maven-plugin

Download debug-maven-plugin

How to add to project

<plugin>
    <groupId>de.mytoys.maven.plugins</groupId>
    <artifactId>debug-maven-plugin</artifactId>
    <version>1.5</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.0
org.apache.maven.plugins : maven-dependency-plugin jar 2.2
com.google.guava : guava jar r09

Project Modules

There are no modules declared in this project.

#debug-maven-plugin

Sadly, if Maven hits a version conflict whilst resolving artifact dependencies the error messages are less than helpful because they do not specify which (transitive) dependencies are causing the conflict. Maven 3 is no better in this regard than Maven 2 - in fact it is worse.

This plugin assists the developer to debug exactly these dependency resolution problems.

It has the following goals (the artifact has been uploaded to Maven Central so will be available without specifying a separate repository):

##tree Command line:

mvn de.mytoys.maven.plugins:debug-maven-plugin:tree

This goal is a slightly modified version of dependency:resolve. The difference is that dependency:resolve requires an already resolved dependeny tree, which is obviously not available in the case of a conflict.

Hence, the tree shown by this goal might still contain version conflicts.

##conflict

Command line:

mvn de.mytoys.maven.plugins:debug-maven-plugin:conflict

Shows direct and transitive artifacts and their paths to the current project sorted by artifactId if they are determined to possibly contain a version conflict. Again, for this to work the dependency tree is not resolved fully which means this can contain version conflicts.

##Shorter command line

If you add the following to your settings.xml

<pluginGroups>
 <pluginGroup>de.mytoys.maven.plugins</pluginGroup>
</pluginGroups>

you can call the plugin like this:

mvn debug:conflict

Alternatively you can establish the plugin in your build process

<build>
  ...
  <plugins>
    <plugin>
       <groupId>de.mytoys.maven.plugins</groupId>
       <artifactId>debug-maven-plugin</artifactId>
       <version>1.7-SNAPSHOT</version>
       <configuration>
         <failOnConflict>false</failOnConflict>
       </configuration>
       <executions>
         <execution>
           <phase>validate</phase>
           <goals>
             <goal>conflict</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
 ...

Setting the configuration failOnConflict to true will cause the build to fail when any conflicts appear (paranoid mode). Default value for the parameter is false (sane).

Versions

Version
1.5