Explanation: That is, the project to use a certain A.jar package, through the introduction of MAVEN, and automatically import the package that the jar depends on, there is a problem, if the A.jar package depends on B.jar 1.0 version of this project, but my project has B.jar this project 2.0 version, here will The solution to this conflict is to remove the dependency of the A.jar package on the 1.0 version of the B.jar project, so that the project uses the packages I already have.
Recently set up a springmvc4.x maven environment, because to use the Webserice, intends to integrate Jersey to do, in the import Jersey-spring.jar, there is such a problem, I use the Jersey-spring1.81.jar version, the project relies on the SPR Ing3, So add Jersey-spring1.81.jar to maven or it happens that because it relies on spring3.x, it automatically imports the spring3.x jar and automatically deletes my spring4.x package, causing the spring4.x to not build at all, but I have There is a 4.x package, completely do not need it to automatically import 3 of the package to remove 4 of the package AH
Resolution version:
Remove the original dependency of Jersey-spring1.81.jar, so that it does not automatically go to the Spring3 package, but the use of my existing SPRING4 package,
Similarly, a similar problem can be solved in the future, the rule is to import a package to remove the original dependency of the label, the label is written to remove the ID and version of the package.
Paste the Solution code:
---------------------------------------------------------------------------
<dependency><groupid>com.sun.jersey.contribs</groupid><artifactid>jersey-spring</ artifactid><version>1.18.1</version><!--Remove your own spring version-<exclusions> <exclusion> <groupId>org.springframework</groupId> <artifact Id>spring-aop</artifactid> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <GROUPID>ORG.SPRINGFRAMEWORK&L T;/groupid> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> < Artifactid>spring-core</artifactid> </exclusion> <exclusion> <artifactid>spring-web& Lt;/artifactid> <groupId>org.springframework</groupId> </exclusion> </exclusions></dependency>
Maven project, removing unwanted dependencies in jar packages