Maven is really a good project management tool, and you don't need to download the dependency pack in advance, just add it to your profile and download it automatically, compared to the more traditional javaide. However, because of Maven's transitive dependency feature, Maven downloads a dependency package along with the jar package's dependency package, which also introduces the problem of jar package conflict.
Workaround:
1. View dependencies:
If you are using Eclipse for development, you can right-click on your project and then choose the Maven build, run as, and fill in the Goals box with Dependency:tree, enter and run.
If not, you can use the command line, using the command MVN dependency:tree
2. Remove the conflicting dependency package
Add exclusion to the package referenced in Pom.xml, excluding dependencies, such as:
1 <!--Remove a single dependency -2 <Dependency>3 <groupId>Com.alibaba</groupId>4 <Artifactid>Dubbo</Artifactid>5 <version>2.5.3</version>6 <Exclusions>7 <exclusion>8 <Artifactid>Spring</Artifactid>9 <groupId>Org.springframework</groupId>Ten </exclusion> One </Exclusions> A </Dependency> - <!--Remove all dependencies - - <Dependency> the <groupId>Com.alibaba</groupId> - <Artifactid>Dubbo</Artifactid> - <version>2.5.3</version> - <Exclusions> + <exclusion> - <Artifactid>*</Artifactid> + <groupId>*</groupId> A </exclusion> at </Exclusions> - </Dependency>
MAVEN Project jar package Conflict resolution method