当前位置:   article > 正文

Maven:项目无法产生Maven Dependencies且无法update project报cannot nest错误

Maven:项目无法产生Maven Dependencies且无法update project报cannot nest错误

找自己出错项目的.classpath文件,打开,ctrl+f,找是否有以下文件,如果没有在末尾加进去,再refresh项目即可:

  1. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  2. <attributes>
  3. <attribute name="maven.pomderived" value="true"/>
  4. <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
  5. </attributes>
  6. </classpathentry>

添加后我的.classpath文件是这样的:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" path="src/main/java"/>
  4. <classpathentry kind="src" path="src/main/resources"/>
  5. <classpathentry kind="src" path="src/extend/java"/>
  6. <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
  7. <attributes>
  8. <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
  9. </attributes>
  10. </classpathentry>
  11. <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
  12. <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0 (2)">
  13. <attributes>
  14. <attribute name="owner.project.facets" value="jst.web"/>
  15. </attributes>
  16. </classpathentry>
  17. <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7">
  18. <attributes>
  19. <attribute name="owner.project.facets" value="java"/>
  20. </attributes>
  21. </classpathentry>
  22. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  23. <attributes>
  24. <attribute name="maven.pomderived" value="true"/>
  25. <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
  26. </attributes>
  27. </classpathentry>
  28. <classpathentry kind="output" path="build/classes"/>
  29. </classpath>

这样项目就没有什么问题了!

项目加载是要读取.classpath文件的,加载不到且Maven不能update project说cannot nest错误。 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/86987?site
推荐阅读
相关标签
  

闽ICP备14008679号