Add a local jar using maven---in eclipse

Source: Internet
Author: User

Eclipse uses MAVEN to deliver the management of the jar package to maven.

1. To add a jar, you can directly in the pom.xml in the dependencies Point Add button, in the inside to search for the jar package, if the MAVEN library exists, it is displayed, select can. Screenshots are as follows:



2. If the required jar is not available in the MAVEN library, you need to download it yourself and add the local jar.

There are 2 ways to add a local jar: one: In the MAVEN local repository (a folder that has a jar), place the jar package under the Goupid folder in Pom.xml.

Method Two: Use the MVN install command to match, the command example is as follows:

MVN install:install-file-dfile=d:\maven-jar\hsviewclient-2.0.jar-dgroupid=com.hsview.client-dartifactid= Hsviewclient-dversion=2.0-dpackaging=jar

Description:-dfile is the location of the jar package you downloaded-dgroupid is the corresponding GroupID DartifactId in the POM is also the corresponding dartifactid in the Pom, is also the jar package name (-the part before the symbol),

-dversion is the version of the jar package (-the part behind the symbol)-dpackaging=jar


Method Two is placed in the CMD window to execute the above command.

Successful execution, hint: build success.

If the above command succeeds, you need to match MAVEN's environment variables in advance, not to mention, over.

Related Article

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.