本文主要是介绍Maven:项目无法产生Maven Dependencies且无法update project报cannot nest错误,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
找自己出错项目的.classpath文件,打开,ctrl+f,找是否有以下文件,如果没有在末尾加进去,再refresh项目即可:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"><attributes><attribute name="maven.pomderived" value="true"/><attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/></attributes>
</classpathentry>
添加后我的.classpath文件是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<classpath><classpathentry kind="src" path="src/main/java"/><classpathentry kind="src" path="src/main/resources"/><classpathentry kind="src" path="src/extend/java"/><classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"><attributes><attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/></attributes></classpathentry><classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/><classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0 (2)"><attributes><attribute name="owner.project.facets" value="jst.web"/></attributes></classpathentry><classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"><attributes><attribute name="owner.project.facets" value="java"/></attributes></classpathentry><classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"><attributes><attribute name="maven.pomderived" value="true"/><attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/></attributes></classpathentry><classpathentry kind="output" path="build/classes"/>
</classpath>
这样项目就没有什么问题了!
项目加载是要读取.classpath文件的,加载不到且Maven不能update project说cannot nest错误。
这篇关于Maven:项目无法产生Maven Dependencies且无法update project报cannot nest错误的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!