Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml
Asked Answered
A

12

40

Missing artifact com.oracle in pom.xml

I am using Eclipse Luna and working on a maven project. When I add the entry for ojdbc jar in pom.xml , it is giving error in the xml. I can't find any reason for the issue as groupId, artifactId and version are correct.

How can I fix the problem?

Aliphatic answered 4/8, 2014 at 21:55 Comment(2)
Have you manually added this jar to your local repo or specified a repo that contains it?Crenellate
Possible duplicate of Find Oracle JDBC driver in Maven repositoryBreakout
M
72

Due to Oracle license restriction, there are no public repositories that provide ojdbc jar.

You need to download it and install in your local repository. Get jar from Oracle and install it in your local maven repository using

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

If you are using ojdbc7, here is the link

Meenen answered 4/8, 2014 at 22:0 Comment(2)
Also visit [#9898999 for complete discussion on this topicChryso
i placed the jar in the bin folder and ran this script: mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jarJunkojunkyard
R
11

This is the quickest way to solve the problem but it's not recommended because its applicable only for your local system.

Download the jar, comment your previous entry for ojdbc6, and give a new local entry like so:

Previous Entry:

<!-- OJDBC6 Dependency -->
        <!-- <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>1.0</version>
            <scope>runtime</scope>
        </dependency> -->

New Entry:

<dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/ojdbc6/ojdbc6.jar</systemPath>
        </dependency> 
Radioactive answered 18/4, 2017 at 7:25 Comment(2)
What's this {project.basedir}? Checked the project location folder but couldn't find the lib folder as in "{project.basedir}/lib/". Can you help me locate it appropriately?Uproot
@Uproot You need to download ojdbc6 jar from internet. This file location is anywhere in your system where you have put the jar. It is not present already. You decide the location.Radioactive
K
4

Place ojdbc6.jar in your project resources folder of eclipse. then add the following dependency code in your pom.xml

<dependency>
<groupId> oracle </groupId>
 <artifactId>ojdbc6</artifactId>
 <version>11.2.0</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/src/main/resources/ojdbc6.jar</systemPath>
</dependency>
Kast answered 24/4, 2018 at 11:4 Comment(0)
D
2

Download the oracle ojdbc driver from Oracle official website.

Install/Add Oracle driver to the local maven repository mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dpackaging=jar -Dversion=12.1.0.1 -Dfile=ojdbc7.jar -DgeneratePom=true

Specify the downloaded file location via -Dfile=

Add the following dependency in your pom file

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc7</artifactId>
    <version>12.1.0.1</version>
</dependency>

Use the same groupId/artifactId as specified in your mvn install command. Finally clean your project.

Damicke answered 18/1, 2017 at 10:35 Comment(0)
F
2

You might have problem on Windows while adding jar to maven because of syntax.

Try encapsulating -D parameters with double quotas like this;

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

Be aware of you should use same version/atifactId/groupId inside your pom.xml. You can't use version 11.2.0.3 after command above. You have to put his in you pom.xml;

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

If you want to use another version, like 12.1.0.1, you should run above command with that version or other info

Fred answered 11/4, 2019 at 11:48 Comment(0)
T
2

I had the same issue. Jenkins's build was falling because of this error..after long hours troubleshooting.

Link to download ojdbc as per your requirement - https://www.oracle.com/database/technologies/maven-central-guide.html

I have downloaded in my maven/bin location and executed the below command.

mvn install:install-file -Dfile=ojdbc8-12.2.0.1.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar

POM.xml

<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
Tiny answered 31/7, 2020 at 8:23 Comment(1)
Feel free to add your commentsTiny
E
1

Add this is work for me

<repositories>
    <!-- Repository for ORACLE JDBC Driver -->
    <repository>
        <id>codelds</id>
        <url>https://code.lds.org/nexus/content/groups/main-repo</url>
    </repository>
</repositories>
Errand answered 5/7, 2018 at 7:34 Comment(0)
T
0

It's due to the missing of ojdbc6.jar in the maven repository. download it Click Here

Add the dependency in the pom.xml file

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

Install/Add Oracle driver to the local maven repository using the following command in command prompt.

  1. open command prompt
  2. change directory to the apache-maven/bin folder Eg: cd C:\Users\Public\Documents\apache-maven-3.5.2\bin
  3. type the command

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

Eg: mvn install:install-file -Dfile=C://Users//Codemaker//Downloads//Compressed//ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

NB: use double back slash to seperate folders (//)

Tuchun answered 14/2, 2019 at 16:29 Comment(0)
J
0

You need to check your config file if it has correct values such as systempath and artifact Id.

    <dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>C:\Users\Akshay\Downloads\ojdbc6.jar</systemPath>
    </dependency> 
Josiah answered 25/12, 2019 at 15:6 Comment(2)
Please add some explanation to your answer as to why is it relevant to OP's answer.Drying
As i had same issue and i resolve it by providing proper system path of jar file then issue resolved.Josiah
C
0

Sometimes even though the jar is available in the folder the error will not go way to overcome this just change a group id to a meaningful one.

Cascarilla answered 12/4, 2023 at 10:0 Comment(0)
P
-1

try this one

    <dependency>
        <groupId>com.hynnet</groupId>
        <artifactId>oracle-driver-ojdbc6</artifactId>
        <version>12.1.0.1</version>
    </dependency>
Preposterous answered 19/7, 2017 at 17:12 Comment(1)
Still getting error Failure to find com.hynnet:oracle-driver-ojdbc6:jar:12.1.0.1 in repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -Perspicuous
H
-3

oracle driver. `

<dependency>
    <groupId>com.hynnet</groupId>
    <artifactId>jdbc-fo</artifactId>
    <version>12.1.0.2</version>
</dependency>

`

Hangman answered 23/11, 2020 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.