Adding ojdbc maven dependency in pom.xml

Here we will see how to add oracle dependency in pom.xml.

Step 1 – Download ojdbc6.jar. Keep it somewhere in your machine. For example, I have kept it in the below directory.

 

Now go to your codebase where we have pom.xml and open cmd or git bash for running the command. For example in my case, I will go till below folder.

 

Run the below command.

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=C:/Users/anjali/springbootwithtomcat/ojdbc6.jar -DgeneratePom=true

Don’t forget to change location of your jar, after download where you have kept it.

Now you will not see any error, you have successfully added oracle JDBC dependency in pom.