开发者

Maven 3.0.3 - how to check dependency conflict reason

Is there an easy way to ch开发者_C百科eck what is the reason of dependency conflict in maven 3.0.3? It was easy with maven 2.x by using debug mode (-X switch). Since maven 3.0.3, -X doesn't show dependencies resolution problems. Maven just produce conflict info without giving the underlying source reason.


With Maven (>= 3.0.0) I use the Sonatype m2eclipse plugin with Eclipse or alternative the latest Spring Tool Suite to graphically visualize the dependency tree and therefore solve any conflict problem. Once the Maven project get imported into the IDE open the POM with the 'Maven POM Editor' and see the 'Dependency Hierarchy' and 'Dependency Graph' tabs. To import the Maven Project, go to File / Import Project / Maven / Existing Maven Projects.
In order to use your recently downloaded Maven 3.X.Y version instead of the default Eclipse-embedded Maven installation, go to Windows / Preferences / Maven / Installations and Add an external Maven home location. Additionally you shall enable the 'Show advanced tabs in the POM editor' in the section Windows / Preferences / Maven / POM Editor.


For those who use IntelliJ, I recommend Maven Helper plugin. You have a specific section for conflicts, and it even allow you to exclude for resolving conflicts.

In general, you can use mvn dependency:tree > "output.txt" and search in the output file the problematic dependency and see what import it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜