Before using Eclipse to test MAVEN's Web project, you can automatically publish your workspace's Web project code to the F:\IWorkspace\.metadata\.plugins\ by clicking "Clean" on the inside of the Eclipse Tomcat right button. 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>
Open it again.Maven Web sub-module. classpath file, 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 some, but be sure to confirm that there is no such attribute <attribute name= "org.eclipse.jst.component.dependency" value= "/web-inf/lib"/>.
Then refresh the MAVEN project on the Eclipse Project and click on "Clean" on the Tomcat for this project. 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