Eclipse导入Maven项目解决Build Path不能配置问题
Posted ycyzharry
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eclipse导入Maven项目解决Build Path不能配置问题相关的知识,希望对你有一定的参考价值。
Eclipse Mars Release (4.5.0)导入Maven项目时,发现项目Build Path不能配置,如下图所示:
解决办法:
1修改Project Facets
项目右键--->Properties--->Project Facets--->Convert to faceted from..--->勾选Java
2 修改项目下.classpath文件,以我本地项目为例:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" output="target/classes" path="src/main/java"/> <classpathentry kind="src" output="target/classes" path="src/main/resources"/> <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> <attributes> <attribute name="owner.project.facets" value="java"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <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="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0"/> <classpathentry kind="output" path="target/classes"/> </classpath>
3 再次查看项目,出现Build Path配置选项:
以上是关于Eclipse导入Maven项目解决Build Path不能配置问题的主要内容,如果未能解决你的问题,请参考以下文章
eclipse导入maven工程,右键没有build path和工程不能自动编译解决方法
Eclipse导入Maven项目出现:Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin: