今天项目中需要用到一个JSON的依赖包(json-lib)
虽然根据https://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4查到pom应该这样导入:
<!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib --> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> </dependency>
但是这样发现始终无法导入依赖:
Cannot resolve net.sf.json-lib:json-lib:2.4
原来json-lib有两个版本的实现:json-lib-2.4-jdk13.jar和json-lib-2.4-jdk15.jar
所以换成如下方式解决:
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency>
文章评论