Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing artifact com.oracle:ojdbc6:jar:11.2.0.3

Tags:

java

maven

oracle

enter image description hereI am a beginner to Maven project. In my project, I am getting the error Missing artifact com.oracle:ojdbc6:jar:11.2.0.3, even though the jar was present in my repository at the correct folder. Can anyone help with this, please?

like image 586
Ramesh Kumar Chikoti Avatar asked May 29 '17 09:05

Ramesh Kumar Chikoti


People also ask

How do I get ojdbc6 jar?

You will get those jars when installing the Oracle Client, the ojdbcX. jar files appear in ORACLE_HOME/jdbc/lib. The *. so isn't a java library, and it shouldn't be included in the classpath.

What is ojdbc6 jar?

The "ojdbc6. jar" file constitutes the Oracle thin client-side JDBC driver which is compatible with Java 6 (JDBC level 4.0).

What is the difference between ojdbc6 and ojdbc7?

Note that another difference between ojdbc6 and ojdbc7 is the supported Oracle version. Specifically ojdbc7 does not support Oracle 11.2 or 11gR2 whereas ojdbc6 does: source. Save this answer.


2 Answers

Unfortunately, due to the binary license, there is no public repository with the Oracle Driver JAR, so you cannot just add it to your pom file.

You have to add this jar manually:

First, you have to download ojdbc6.jar from here click jar (2.6 MB) on the middle of the page.

Then put ojdbc6.jar in some folder in your project (let's use lib).

Then you have to add this in your dependencies section in your pom.xml:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc</artifactId>
    <version>11.2.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/ojdbc6.jar</systemPath>
</dependency>

Another option is to install this jar in your local maven repository:

mvn install:install-file -Dfile=path/to/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

And then you will be able to reference this dependency like this:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0</version>
</dependency>

You have to choose what's best for you.

like image 52
Krzysztof Atłasik Avatar answered Sep 20 '22 07:09

Krzysztof Atłasik


Remove the ojdbc6 folder from the .m2 repository completely and then maven update the project in enclipse that solved my problem

like image 24
Ramesh Kumar Chikoti Avatar answered Sep 20 '22 07:09

Ramesh Kumar Chikoti