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 错误
错误:读取 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 在刷新多数就可以了