Failure to find net.sf.json-lib:json-lib:jar:2.2.2

Could not resolve dependencies for project com.platform:platform-gateway:jar:1.0: Failure to find net.sf.json-lib:json-lib:jar:2.2.2 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]

在项目中添加json-lib依赖时:java

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

项目打包时时,执行 mvn package 查看到具体的详细信息:提示: Could not resolve dependencies for project com.platform:platform-gateway:jar:1.0: Failure to find net.sf.json-lib:json-lib:jar:2.2.2 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]
的错误json

根据提示打开: http://uk.maven.org/maven2/net/sf/json-lib/json-lib/2.4/maven

看到:spa

jar的名称中多了 jdk1三、jdk15,因此须要添加classfier。classifier表示在相同版本下针对不一样的环境或者jdk使用的jar, 若是配置了这个元素,则会将这个元素名在加在jar包的后面来查找相应的jar,因此上面的json-lib-2,4是找不到jar包的。修改成如下配置:code

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

这样配置便可找到json-lib-2.4-jdk15.jar 。orm

相关文章
相关标签/搜索