Guide to installing 3rd party JARs

Source: Internet
Author: User

Although rarely, but sometimes you'll have a 3rd party JARs that's need to put in your local repository for use in your builds, since they don ' t exist in any public repository like Maven Central. The JARs must is placed in the local repository in the correct place in order for it to is correctly picked up by Apache M Aven. To do this easier, and less error prone, we had provide a goal in the maven-install-plugin which should make this Relat Ively Painless. To install a JAR in the local repository use the following command:

    MVN install:install-file-dfile=<path-to-file> -dgroupid=<  Group-id>         -dartifactid=<Artifact-id> - Dversion=<version> -dpackaging=<packaging  >

If there ' s a pom-file as well, you can install it with the following command:

    MVN install:install-file-dfile=<path-to-file> -dpomfile=<  Path-to-pomfile>

With version 2.5 of the maven-install-plugin it gets even better. If The JAR is built by Apache Maven, it ' ll contain a pom.xml in a subfolder of the Meta-inf directory, which would be read By default. In the case, all of you need to does is:

    MVN install:install-file-dfile=<path-to-file>

Because of Oracle's commercial copyright issues, maven cannot download the jar package directly from the central repository, and if you want to use a jar package, you need to handle it manually.
The first step: put Ojdbc6.jar in any directory, for example: D:\download\oracle11g Drive Jar Package
Step Two: (To configure and install MAVEN, which can be verified by mvn-version) is executed in the cmd command

MVN install:install-file-dgroupid=com.oracle-dartifactid=ojdbc6-dversion=11.1.0.7.0-dpackaging=jar-dfile=d:\ Download\ojdbc6.jar

This installs the JDBC driver into the MAVEN local repository and into the MAVEN local repository: D:\Maven\localRepository, you can see that the Ojdbc6.jar has been packaged into a local repository.

Step three: Add dependency to the Pom.xml in the desired project

        <Dependency><groupId>Com.oracle</groupId><Artifactid>Ojdbc6</Artifactid><version>11.1.0.7.0</version></Dependency>

The deployment of the Maven jar package is complete

Guide to installing 3rd party JARs

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.