maven-Adding a local jar package to the local warehouse

Source: Internet
Author: User

  

I. Usage scenarios

1. If you want to configure use in the Maven pom file, you must add the jar package to the MAVEN repository in accordance with the MAVEN specification, and then you can configure the reference in the Pom.

Two. Preparatory work

1. The computer is already installed MAVEN, the local warehouse is configured.

2.jar package path, e.g. D:jar/junit-4.11.jar

Three. Operation procedure

1. Open the Computer cmd command window

2.cd to D:jar, of course, you can not use the CD to the path of the jar package, This is just for the back of the path of less jar package

3. Enter the command:

MVN Install:install-file-dfile=junit-4.11.jar-dgroupid=junit-dartifactid=junit-dversion=4.11-dpackaging=jar

4. See Bulld SUCCESS Description Success

Four. Inspection

Introducing dependencies into the POM in a MAVEN project

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

Jar entered successfully, indicating OK

maven-Adding a local jar package to the local warehouse

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.