When standard WEB engineering uses the M2eclipse plug-in to add dependency management in Eclipse, the dependent jar packages are not automatically copied to/web-inf/lib during deployment.
Refer to some Friends practice manual execution
[Java] view plaincopy
MVN Dependency:copy-dependencies-doutputdirectory=src/main/webapp/web-inf/lib-dincludescope=runtime
command to copy the jar package to the/web-inf/lib directory.
This is possible, but it can also cause some inconvenience.
1, need to execute the command manually.
2, can not be updated constantly.
The following is a list of the workarounds found on the web, and the M2eclipse plugin method has been validated.
By verifying the Eclipse version: Eclipse-jee-helios-sr2-win32
M2eclipse Plugin Address: http://m2eclipse.sonatype.org/sites/m2e
Standard Web Engineering adds dependency management steps through M2eclipse:
1, "Maven" –> "Enable dependency Management"
2. Add Maven dependencies to the Web Deployment assembly
Steps such as:
Preferences, right-click Project
There are modifications in the. classpath file
[XHTML] View Plaincopy
<classpathentry kind= "Con" path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
For
[XHTML] View Plaincopy
-
<classpathentry kind= "con" path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" >
-
<attributes>
-
<attribute name= " Org.eclipse.jst.component.dependency " value="/web-inf/lib "/>&NBSP;&NBSP;
-
</attributes>
-
</classpathentry>
(the "Maven" –> "Update Project Configuration" is not in effect, so add it manually.) It is necessary to deploy the jar package to the Lib directory, rather than copy the jar package when updating Maven dependencies. )
Maven managed jars are not released to the Web-inf/lib solution