The json-lib library in maven cannot be imported

Today, the json-lib library was introduced into maven. The pom file in intellij did not report an error, but it could not be used in the class.

pom dependency configuration:

<dependency>      
    <groupId>net.sf.json-lib</groupId>     
    <artifactId>json-lib</artifactId>      
    <version>2.4</version>      
</dependency> 

 


After searching the information, it was found that the json-lib library has two versions of jdk implementations, json-lib-2.1-jdk13.jar and json-lib-2.1-jdk15.jar, which need to be added with descriptors.

 

<dependency>    
    <groupId>net.sf.json-lib</groupId>    
    <artifactId>json-lib</artifactId>    
    <version>2.4</version>    
    <classifier>jdk15</classifier>    
</dependency>  

 

 

When I used it again, I found that there was no problem. Reference: http://www.cnblogs.com/yqskj/archive/2013/05/27/3101934.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325858788&siteId=291194637