念念不忘
必有回响🎉

解决Jenkins构建时提示json-lib下载失败

在使用Jenkins构建项目是,总是过不去,查看日志发现是因为有个json-lib的依赖没有下载下来导致的,具体错误日志如下:

09:58:28 Waiting for Jenkins to finish collecting data
09:58:28 [ERROR] Failed to execute goal on project dw: Could not resolve dependencies for project pro.liyang:dw:jar:0.0.1-SNAPSHOT: Could not find artifact net.sf.json-lib:json-lib:jar:2.4 in mvnrepository (http://central.maven.org/maven2/) -> [Help 1]
09:58:28 [ERROR] 
09:58:28 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
09:58:28 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
09:58:28 [ERROR] 

啊是的

无论换什么仓库都不好使,最终通过搜索了解到使用json-lib时需要多加一个选项<classifier>jdk15</classifier>

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

此时便可以解决该问题。

题外话,之前看到过文章有gson,fastson,jackson,json-lib的性能评测,json-lib的性能一直是最差的。而且也已经好多年不更新了。后面还是找机会把这个弃了吧。🙂

解决Jenkins构建时提示json-lib下载失败
Rate this post
赞(1) 打赏
未经允许不得转载:Charles's Blog » 解决Jenkins构建时提示json-lib下载失败

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏