欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maven依赖json-lib.jar报错 json-libmaven json-lib 

程序员文章站 2024-02-24 16:04:41
...

pom.xml 内容:

 

  1. <dependency>    
  2.         <groupId>net.sf.json-lib</groupId>    
  3.         <artifactId>json-lib</artifactId>    
  4.         <version>2.4</version>    
  5.  </dependency>    
<dependency>  
        <groupId>net.sf.json-lib</groupId>  
        <artifactId>json-lib</artifactId>  
        <version>2.4</version>  
 </dependency>  

 

 

报错误:Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile

原因:json-lib是需要区分jdk版本的,pom.xml中的配置应加上标签classifier指定jdk版本,如用jdk15

修改为:

 

  1. <dependency>    
  2.     <groupId>net.sf.json-lib</groupId>    
  3.     <artifactId>json-lib</artifactId>    
  4.     <version>2.4</version>    
  5.     <classifier>jdk15</classifier><!--指定jdk版本-->    
  6. </dependency>   
<dependency>  
	<groupId>net.sf.json-lib</groupId>  
	<artifactId>json-lib</artifactId>  
	<version>2.4</version>  
	<classifier>jdk15</classifier><!--指定jdk版本-->  
</dependency> 

 

类似问题:

maven javax.transaction:jta:jar:1.0.1B:compile错误提示:

  解决办法:

 

  1. <dependency>  
  2.     <groupId>org.hibernate</groupId>  
  3.     <artifactId>hibernate</artifactId>  
  4.     <version>3.2.1.ga</version>  
  5.     <optional>false</optional>  
  6.     <exclusions>  
  7.         <exclusion>  
  8.             <artifactId>jta</artifactId>  
  9.             <groupId>javax.transaction</groupId>  
  10.         </exclusion>  
  11.     </exclusions>  
  12. </dependency>  
maven依赖json-lib.jar报错
            
    
    
        json-libmaven json-lib 
<dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate</artifactId>
	<version>3.2.1.ga</version>
	<optional>false</optional>
	<exclusions>
		<exclusion>
			<artifactId>jta</artifactId>
			<groupId>javax.transaction</groupId>
		</exclusion>
	</exclusions>
</dependency>

 

 

log4j.jar引起的missing artifact javax jms jms jar 1.1问题:

解决办法:原因是log4j在1.2.15及以上版本更换了协议,与jms冲突,所以用log4j的1.2.14版本就可以啦

 

  1. <dependency>  
  2.     <groupId>log4j</groupId>  
  3.     <artifactId>log4j</artifactId>  
  4.     <version>1.2.14</version>  
  5. </dependency>  
maven依赖json-lib.jar报错
            
    
    
        json-libmaven json-lib 
<dependency>
	<groupId>log4j</groupId>
	<artifactId>log4j</artifactId>
	<version>1.2.14</version>
</dependency>