How to add OJDBC jar to Maven Repository | Oracle Ojdbc jar as maven

PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
This guide helps you to understand how to add OJDBC jar to Maven repository.
Unfortunately due to the Oracle binary licensing restrictions, the ojdbc driver jar is not available on Maven public repository. If you find this jar any public repository probably its illegal. So that we can not directly access ojdbc jar from Maven repository.
In this tutorial, we will see how to add ojdbc jar into our local maven repository.
Download the latest ojdbc jar (For me it is ojdbc8.jar) from Oracle’s website.
Execute the below maven command to install ojdbc and adding it into your local maven local repository.
$ mvn install:install-file -Dfile={your_path/ojdbc8.jar} 
-DgroupId=com.oracle -DartifactId=jdbc8 -Dversion=12.2.0.1 -Dpackaging=jar
Specify your ojdbc(6 or 7 or 8).jar to -Dfile=PATH.
cgoka@work:~/Documents/Work/maven$ mvn install:install-file -Dfile=/home/cgoka/Softwares/ojdbc8.jar -DgroupId=com.oracle -DartifactId=jdbc8 -Dversion=12.2.0.1 -Dpackaging=jar -X
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 11.0.2, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-11-oracle
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-46-generic", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
....
....
[DEBUG] (f) version = 12.2.0.1
[DEBUG] -- end configuration --
[DEBUG] Installing generated POM
[INFO] Installing /home/cgoka/Softwares/ojdbc8.jar to /home/cgoka/.m2/repository/com/oracle/jdbc8/12.2.0.1/jdbc8-12.2.0.1.jar
[DEBUG] Writing tracking file /home/cgoka/.m2/repository/com/oracle/jdbc8/12.2.0.1/_remote.repositories
[INFO] Installing /tmp/mvninstall6894711908436548564.pom to /home/cgoka/.m2/repository/com/oracle/jdbc8/12.2.0.1/jdbc8-12.2.0.1.pom
[DEBUG] Writing tracking file /home/cgoka/.m2/repository/com/oracle/jdbc8/12.2.0.1/_remote.repositories
[DEBUG] Installing com.oracle:jdbc8/maven-metadata.xml to /home/cgoka/.m2/repository/com/oracle/jdbc8/maven-metadata-local.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Its Done.
Access ojdbc8.jar from application’s pom.xml like below.
 <dependencies>
  <dependency>
  <groupId>com.oracle</groupId>
  <artifactId>jdbc8</artifactId>
  <version>12.2.0.1</version>
  </dependency>
</dependencies>
Adding OJDBC jar to the maven repository
How to install maven on windows
Happy Learning 🙂

How to install Maven on Windows10
How to Install Kubernetes on Ubuntu 18.04
How to install Maven on Ubuntu 14.x
Spring Boot Batch Example Csv to Database
How to install Maven on windows 7 command line
Spring Boot Kafka Producer Example
@Component,@Service,@Repository,@Controller in spring
How to install Apache Kafka on Ubuntu 18.04
How to install Java 11 on Ubuntu 18.04
Spring Boot Kafka Consume JSON Messages Example
Step by Step – How to push the project into GIT Repository
Sending Spring Boot Kafka JSON Message to Kafka Topic

How to install Maven on Windows10
How to Install Kubernetes on Ubuntu 18.04
How to install Maven on Ubuntu 14.x
Spring Boot Batch Example Csv to Database
How to install Maven on windows 7 command line
Spring Boot Kafka Producer Example
@Component,@Service,@Repository,@Controller in spring
How to install Apache Kafka on Ubuntu 18.04
How to install Java 11 on Ubuntu 18.04
Spring Boot Kafka Consume JSON Messages Example
Step by Step – How to push the project into GIT Repository
Sending Spring Boot Kafka JSON Message to Kafka Topic