美文网首页
解决:Maven 工程中缺少 “Maven Dependenci

解决:Maven 工程中缺少 “Maven Dependenci

作者: 平行线 | 来源:发表于2016-05-11 18:28 被阅读1620次
Maven 工程中缺少 “Maven Dependencise”目录

解决方法:右键工程-->show in--->system explorer 找到工程对应的“.classpath”文件修改节点即可。

1:对比正确的“.classpath”文件和错误的“.classpath”文件
错误的“.classpath”文件 正确的“.classpath”文件

从截图可以看出是缺少了依赖maven的节点所以加上节点。

2:修改classpath文件
把<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
        <attributes>
            <attribute name="owner.project.facets" value="java"/>
        </attributes>
    </classpathentry>
修改为:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>

===============
添加:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>

==============
把<classpathentry kind="output" path="bin"/>
修改为:
<classpathentry kind="output" path="target/classes"/>

3:刷新工程即可

右键工程--->refresh后就会出现缺失的“Maven Dependencise”目录

又见“Maven Dependencise”目录

希望对看到文章的小伙伴有帮助

相关文章

网友评论

      本文标题:解决:Maven 工程中缺少 “Maven Dependenci

      本文链接:https://www.haomeiwen.com/subject/egdurttx.html