"IDEA plug-in" Maven Helper, an artifact that solves Maven dependency conflicts

When writing Java code, we may have problems with Jar package conflicts. At this time, we need to resolve dependency conflicts. To resolve dependency conflicts, we must first find out which dependencies are in conflict. IDEA's Diagrams can view dependencies, but it seems laborious when there are many dependencies, so a plug-in is needed to solve the problem of dependency conflicts. This plug-in artifact is Maven Helper.

1. Install IDEA Maven Helper

1. Click IDEA's Preferences..., and click File---settings on Windows system.

2. Plugins-->Marketplace-->Input mavn helper-->Click install-->Click "OK" to complete the installation

2. How to use the Maven Helper plug-in

1. Click on the pom.xml file of the project, and you will find that there is a "Dependency Analyzer" tab option below the content of the pom.xml file.

2. Click "Dependency Analyzer"

The three options are as follows:

  • Conflicts (view conflicts)

  • All Dependencies as List (View all dependencies in list form)

  • All Dependencies as Tree (View all dependencies in tree form)

3. When there is no dependency conflict or the dependency conflict is resolved, when you click "Conflicts", the conflict information will be displayed below. We can right-click the conflicting dependency and select Exclude

4. After clicking Exclude, the plug-in will automatically add <exclusion>relevant code to the pom.

3. IEDA uses Maven command to check dependency conflicts

1. When you want to view the maven dependency tree, use the Maven command to view the dependencies.

maven dependency:tree

2. You can also use the Maven command to check whether there are dependency conflicts.

mvn dependency:tree -Dverbose -Dincludes=<groupId>:<artifactId>

Guess you like

Origin blog.csdn.net/songyun333/article/details/133376501