Pom.xml configuration for automatically downloading jar packages in MAVEN projects

Source: Internet
Author: User

Pom.xml configuration for automatically downloading jar packages in MAVEN projects

With maven2, the dependency is set inPom. XML and will help you to download all dependencies. The directory that the jar to M2_repo points to


--------------------------------------------------------------------------------------------

M2_repo is a storage location used to define the MAVEN 2 repository on the hard disk, and Windows defaults to the C:\Users\ machine name \.m2\repository. The M2eclipse plug-in is installed with the appropriate settings in eclipse.

If the M2eclipse plugin is not installed, Eclipse opens the MAVEN project and may error, this time you need to manually set M2_repo.

How to set it up:
Eclipse->windows->preferences->java->build Path->classpath Variables
New one, named M2_repo, property Select Folder, default path C:\Users\ machine name \.m2\repository


Once you've made such a setup, Eclipse integrates MAVEN functionality, and if you add a new dependent jar package in Pom.xml, perform mvn eclipse:eclipse and then refresh workspace at the root of the project. The newly-dependent jar package is added to the project's build path.


The above is the role of M2_repo.

---------------------------------------------------------------------------------------------

Use the MAVEN command to move the jar package to Maven's local repository

MVN Install:install-file-dfile=webapps\root\web-inf\lib\jaas.jar-dgroupid=javax.security-dartifactid=jaas- Dversion=1.0.01-dpackaging=jar



The following points need to be noted.
1. Note "-" must not be missing the "-" after the install is no space
2. Note the path of the jar package in "-dfile" and the name of the jar package.
3. Note The cmd command prompt to see if the jar package was successfully replicated in the local repository.

Pom.xml configuration for automatically downloading jar packages in MAVEN projects

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.