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