1.作用

      有时候maven根据jar包的依赖,会要求classpath中必须包含某个jar,但是我们又不需要这个jar(因为添加了会有冲突)。比如其他jar要求使用common-logging但是本项目需要使用jcl-over-slf4j

      这个使用就可以使用一个空的common-logging来欺骗maven,就是告诉它项目里已经有了common-logging。那么这个空的common-logging就可以以99.0-does-not-exist作为version

 

 

2.使用

   (1)添加仓库

  1. <repositories>    
  2.     <repository>    
  3.         <id>Version99</id>    
  4.         <name>Version 99 Does Not Exist Maven repository</name>    
  5.         <layout>default</layout>    
  6.         <url>http://no-commons-logging.zapto.org/mvn2</url>    
  7.     </repository>    
  8. </repositories>    

   (2)添加依赖

  1. <dependency>    
  2.     <groupId>commons-logging</groupId>    
  3.     <artifactId>commons-logging</artifactId>    
  4.     <version>99.0-does-not-exist</version>    
  5. </dependency>  
 posted on 2018-01-02 14:46  暮归  阅读(353)  评论(0编辑  收藏  举报