maven错误

来源:互联网 发布:linux命令选项格式 编辑:程序博客网 时间:2024/06/05 22:45

Failed to execute goal on project pki-web-struts2:
 Could not resolve dependencies for project cn.com.gfa.pki:pki-web-struts2:jar:3.0.1-SNAPSHOT:
 Failure to find net.sf.json-lib:json-lib:jar:2.2.4 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 nexus-aliyun
has elapsed or updates are forced -> [Help 1]

在用Maven开发JAVA项目时,偶尔会遇到特别诡异的一个错误,就是提示:无效jar包,然后就会中断编译字节码文件,直接导致项目代码出现红色警告,这时,就需要分析一下原因,一般大致有以下几个可能:
    1,在从SVN或者已有的pom.xml引入工程时,由于某种原因,比如突然断电或者关机或者认为cancel了那个更新进度条,导致某些jar包下载到repository中时,没有下载完全,但是的确已经存在了这个jar文件,导致读取时出现无效jar.
    2,jar文件被操作系统破坏,比如,硬盘故障或者病毒等。
    3,其他原因造成repository文件夹中的jar库不完整或者缺失。
  解决方案:删除repository文件夹,确保网络畅通,重启eclipse,执行Maven->Project Update。

0 0
原创粉丝点击