MAVEN's third-party jar package management

Source: Internet
Author: User

Introduction:

One big problem with Maven is the introduction of third-party packages, which are not available in the MAVEN main repository, such as the Springside-core-3.2.3.jar package.

Installing a third-party jar to the local MAVEN repository

Use the following command:

MVN Install:install-file-dgroupid=org.springside-dartifactid=springside-core-dversion=3.2.3-dpackaging=jar- Dfile=springside-core-3.2.3.jar

The effect after operation is as follows:



This jar package can be used by Maven for normal use.

Third-party jar associated to the project

1. Dump the installation directory of the third-party jar in the local MAVEN library to the project Lib folder

Copy a parent project (package type POM) in the folder Lib that installs the local jar package according to the path of the Maven repository intact. See details:



2. Add a reference path to the local repository in the Pom file

This local repository is essentially the same as the remote MAVEN Master Repository, and Maven automatically finds the third-party jar library from the project's Lib folder and installs it to the local Maven repository by setting the local path so that other people download the project and use MAVEN to build the project. This package can then be referenced and used normally. Detailed configuration is as follows:



Where the URL refers to the file://local file path protocol, and the remote warehouse path primarily uses the HTTP protocol. {Basedir} is the directory where the project's Pom file resides. The basic original is based on the path in the URL plus your groupid,artifactid, and version stitching into the final path to find files.


Reference: http://blog.csdn.net/czp11210/article/details/24376169

MAVEN's third-party jar package management

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.