Maven managed jars are not released to the Web-inf/lib solution

Source: Internet
Author: User

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

    1. 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

    1. <classpathentry kind= "Con" path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>


For

[XHTML] View Plaincopy

    1. <classpathentry kind= "con"  path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" >   

    2.         <attributes>  

    3.             <attribute name= " Org.eclipse.jst.component.dependency " value="/web-inf/lib "/>&NBSP;&NBSP;

    4.          </attributes>  

    5.      </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.