主要是作为备注吧,当初解决的时候还是花了不少时间,别又遇上的时候忘了怎么搞。
第一个错误:
eclipse maven web工程。在eclipse的Markers中报感叹号:
Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may resul
解决方法是:对着工程点击右键调出Navigator视图,修改.classpath:
将:
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
修改为:
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
第二个错误:
启动tomcat7 报:
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring01' did not find a matching property.
解决办法:
原因是Context.xml文件Context标签不支持source属性,找到tomcat的Context.xml文件将source属性去掉。
<Context docBase="spring01" path="/spring01" reloadable="true" source="org.eclipse.jst.jee.server:spring01"/></Host>
第三个错误:
1.-Dmaven.multiModuleProjectDirectory system propery is not set.
解决办法是:
在Window->Preference->Java->Installed JREs->Edit
在Default VM arguments中设置:
-Dmaven.multiModuleProjectDirectory=$M2_HOME