maven 项目遇见的错误集合

1、Eclipse中出现无法找到Maven包

    症状:出现 org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER, 且出现无法找到Maven的依赖的问题
  解决方案:Build Path -》 Java Build Path -》 Libraries -》Add Library -》Maven Managed Dependences-》点击Next -》点击‘Maven Project settings’ , 在‘Active Maven Profiles (comma separated)’中添加“ Maven Dependencies”确认即可。此时会在Classpath 的Libraries的标签栏下面看到添加的‘Maven Dependencies’。
 

2、在maven中可能存在如下的错误

在eclipse中表现为无法找到依赖的jar包,而‘Maven Dependencies中却能找到相应的jar包
Failure executing javac, but could not parse the error:
错误:读取 C:\Documents and Settings\keju.wangkj\.m2\repository\com\sun\jdmk\jmxtools\1.2.1\jmxtools
-1.2.1.jar 时出错;error in opening zip file
错误:读取 C:\Documents and Settings\keju.wangkj\.m2\repository\com\sun\jmx\jmxri\1.2.1\jmxri-1.2.1.
jar 时出错;error in opening zip file
2 错误

解决方案:由于maven下载了空壳的jar包在仓库中,只有1k左右,删除之后让maven重新下载
 

3、maven 项目在IED中是红叉或红感叹号解决

      1.先查看problems视图,看看是啥错误,能解决的解决

      2.project下clean项目,再refresh项目

      3.如果出现类似这种错误

 

     eclipse maven error: Archive for required library

      in project cannot be read or is not a valid ZIP file

    解决:选择 IED project标签,

    下的update all maven dependencies 在刷新多数就可以了                                                                                             

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值