Install the local jar package into the MAVEN repository

Source: Internet
Author: User

Development will encounter the inability to download the jar package through Pom.xml, in this case we can manually install the jar package locally to the local repository, so that the next time you can use it again without having to download the network again, specifically for the Oracle driver package Ojdbc6.jar as an example:

1     mvn Install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0-dpackaging=jar-dfile =d:\ojdbc14.jar     2     mvn install:install-file-dgroupid=com.oracle-dartifactid=ojdbc6-dversion=11.2.0.1.0- Dpackaging=jar-dfile=d:\ojdbc6.jar    3     mvn INSTALL:INSTALL-FILE-DGROUPID=COM.ORACLE-DARTIFACTID=OJDBC7- Dversion=12.1.0.1.0-dpackaging=jar-dfile=d:\ojdbc7.jar        4     <dependencies>   5         <!--Oracle JDBC Driver-     6         <dependency>       7             <groupId>com.oracle</groupId>       8             <artifactId>ojdbc14</artifactId>       9             <version>10.2.0.1.0</version>         </dependency>     </dependencies>  

1. Copy the local jar package Odjbc6.jar to a temporary location such as I copied to D:\ojdbc.jar here.

2. Open the cmd command line as an administrator and enter the following command:

1 MVN install:install-file-dgroupid=com.oracle-dartifactid=ojdbc6-dversion=11.2.0.1.0-dpackaging=jar-dfile=d:\ Ojdbc6.jar

The installation was successful and then the information about the jar package is configured in the Pom.xml file, and maven will download it to our locally installed files

1 <dependencies>  2     <!--oracle JDBC Driver--and    3     <dependency>      4         < Groupid>com.oracle</groupid>      5         <artifactId>ojdbc14</artifactId>      6         < version>10.2.0.1.0</version>  7     </dependency>  

Install the local jar package into the MAVEN repository

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.