Use Eclipse to automatically install the directory structure of a dependent jar package in the MAVEN local warehouse __eclipse

Source: Internet
Author: User

Scenario: Maven Project adds third-party jar pack dependencies

Workaround: Create a used dependency directory structure in the local warehouse.

Create the following steps:

A, take Ojdbc14.jar as an example, if we want to write the following reference in Pom.xml:

		<dependency>
			<groupId>me.lib</groupId>
			<artifactid>me-ojdbc14</artifactid >
			<version>10.2.0.1.0</version>
			<scope>compile</scope>
		</dependency >

B, because GroupID is me.lib, it is necessary to create a hierarchy of me/lib in the local warehouse directory, just like the package name

C, followed by Artifactid, version to create the next level of directory, the final form of me/lib/me-ojdbc14/10.2.0.1.0 directory

D, put the Ojdbc14.jar into the me/lib/me-ojdbc14/10.2.0.1.0 directory, renamed to Me-ojdbc14-10.20.1.0.jar, to this even completed


Where steps B, c, and D can be replaced with the MVN command, a command creates a directory structure. First configure the MVN environment variables, the CD enters the directory where Ojdbc14.jar resides, and then execute the following command:

MVN install:install-file-dgroupid=me.lib-dartifactid=me-ojdbc14-dversion=10.2.0.1.0-dpackaging=jar-dfile= Ojdbc14.jar


In the spirit of "lazy", will be tedious to simplify. Let me find a way to get the project running down from the version library. You do not need to find the local warehouse directory location to complete all operations in eclipse.

1, under the MAVEN project, create the directory of the jar package files to reference.

2, edit the project Pom.xml file, increase the configuration project reference warehouse.

3, edit the project Pom.xml file and add jar bundle dependencies.

Look at the picture more intuitive:


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.