before using Eclipse to test MAVEN's Web project, you can automatically publish your workspace's Web project code to "F:\IWorkspace\.metadata\" by clicking on "Clean" in the Eclipse internal Tomcat right button. Plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps "This path is very convenient. If the war package deployed in Tomcat chooses the "Add External Web Module", then the test is going to cry. The MAVEN command is used before each test to repackage, the process of packaging is not only very slow, and when packaging a large number of disk writing, this time your computer is basically not capable of other things.
During this time, my eclipse suddenly failed to use the internal package, the phenomenon is, "\web-inf\lib" This path only a small number of Maven-dependent jar package. Running Tomcat will report classnotfoundexception. The problem has been solved today. The steps are as follows:
open the. project file for the MAVEN Web sub-module,<buildspec> This node to add the following nodes:
<buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand>
The following nodes are added under the <natures> node:
<nature>org.eclipse.m2e.core.maven2Nature</nature>
then open the. classpath file for the MAVEN Web submodule and add the following node:
<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 >
in fact, this node is generally there, but be sure to have this attribute <attribute name= "org.eclipse.jst.component.dependency" value= "/web-inf/lib"/ >.
then refresh the MAVEN project on the Eclipse project and don't refresh the project in eclipse without any effect. Then click "Clean" on the Tomcat message for this item. Then go to the auto-release path and discover that all MAVEN-dependent jar packages are out.
Eclipse MAVEN Project automatic War packet loss jar package problem resolution