Monday, September 12, 2016

Adding external jar to Maven repository

I was facing problem in adding ojdbc.jar in to Maven.

Here is the solution that worked for me.
open cmd promt and execute the following command

mvn install:install-file -Dfile=C:\Users\lenovo\Downloads\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6.jar -Dversion=12 -Dpackaging=jar

Replace the path (marked in yellow with the exact path of your jar).

After the build, the jar will be added to the maven repository.

Dependency will be as below:

<dependency>
  <groupId>com.oracle</groupId>
  <artifactId>ojdbc6.jar</artifactId>
  <version>12</version>
</dependency>

No comments :

Post a Comment