解决使用maven的java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file

java web项目一直都是好好的,后面电脑安装过系统后(以之前的版本不一样),安装所需软件(如myeclipse、tomcat)并进行配置。然后在myeclipse中添加项目却报错了1.Archive for required library: ‘...  .jar’ in project ‘xxxxxxxxx’ cannot be read or is not a valid ZIP file. 2. The project cannot be built until build path errors are resolved.但是我查找了一下那个jar确实是存在的。在网上查找了许久,答案不一:jar不完整、路径问题等等。

解决方案:

1)删除提示错误路径下的所有jar包(C:\Documents and Settings\Administrator\.m2\repository\org...)。

2)安装maven,详细的安装步骤点击here,

3)开始—运行—cmd—进入到web项目所在路径(cd:web项目的路径)—(a)输入mvn compile(编译源代码)回车;(b) mvn clean (清除目标目录中的生成结果)回车;(c)输入mvn clean install或者mvn clean install -DskipTests=true(下载所需jar)回车。





posted @ 2014-04-11 18:44  博客园逛逛  阅读(29203)  评论(0编辑  收藏  举报