Exclude conflict jar Packages
Jar Package Conflict
<Dependencies> <Dependency> <groupId>Org.springframework</groupId> <Artifactid>Spring-core</Artifactid> <version>5.0.6.RELEASE</version> </Dependency> </Dependencies>
When you add the above dependencies in Pom.xml, the following two jar packages are added automatically:
Can see Spring-core automatically comes with spring-jcl-5.0.6.release, also when we add other dependencies, it is possible to automatically join the SPRING-JCL, and the version may not be 5.0.6.RELEASE, this time the two SPRING-JCL The same version will conflict with each other, so we need to rule out the jar version that will make trouble.
Exclude Jar Packages
Open Pom.xml in Eclipse and switch to dependency hierarchy view as follows:
You can see that spring-core is dependent, and SPRING-JCL is an additional jar.
Right-click-exclude...--ok-
When you are finished, the code for Pom.xml appears as follows:
<Dependencies> <Dependency> <groupId>Org.springframework</groupId> <Artifactid>Spring-core</Artifactid> <version>5.0.6.RELEASE</version> <Exclusions> <exclusion> <groupId>Org.springframework</groupId> <Artifactid>Spring-jcl</Artifactid> </exclusion> </Exclusions> </Dependency> </Dependencies>
The jar package inside the exclusions is excluded, leaving only Spring-core:
Reference article: 60330000
(10) Maven conflict-out jar package