修改项目中.classpath文件内容:
<?xml version="1.0" encoding="UTF-8"?>
<classpath><classpathentry kind="src" output=" 替换target输出路径webapp/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output=" 替换target输出路径webapp/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output=" 替换target输出路径webapp/WEB-INF/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</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>
替换lib路径org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER:maven目录结构下的lib找不到,替换以下路径
<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"/>替换lib路径
</attributes>
</classpathentry>
<classpathentry kind="output" path="src/mian/webapp/classes"/>
</classpath>