eclipse的maven工程缺少Maven Dependencies解决办法

  • Post author:
  • Post category:其他


修改.classpath文件,增加如下内容:

<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>

如果src目录也不对,修改src内容如下:

<classpathentry kind="src" output="target/classes" path="src/main/java">
	<attributes>
		<attribute name="optional" value="true"/>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
		<attributes>
			<attribute name="maven.pomderived" value="true"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
		<attributes>
			<attribute name="optional" value="true"/>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>



版权声明:本文为jianjun200607原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。