[java] Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml

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?

This question is related to java maven pom.xml ojdbc artifact

The answer is


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>

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> 

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


try this one

    <dependency>
        <groupId>com.hynnet</groupId>
        <artifactId>oracle-driver-ojdbc6</artifactId>
        <version>12.1.0.1</version>
    </dependency>

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> 

oracle driver. `

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

`


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>

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 (//)


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.


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>

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to maven

Maven dependencies are failing with a 501 error Why am I getting Unknown error in line 1 of pom.xml? Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Unable to compile simple Java 10 / Java 11 project with Maven ERROR Source option 1.5 is no longer supported. Use 1.6 or later 'react-scripts' is not recognized as an internal or external command How to create a Java / Maven project that works in Visual Studio Code? "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

Examples related to pom.xml

Why am I getting Unknown error in line 1 of pom.xml? Maven:Non-resolvable parent POM and 'parent.relativePath' points at wrong local POM Meaning of ${project.basedir} in pom.xml Maven and Spring Boot - non resolvable parent pom - repo.spring.io (Unknown host) Maven: How do I activate a profile from command line? repository element was not specified in the POM inside distributionManagement element or in -DaltDep loymentRepository=id::layout::url parameter What is <scope> under <dependency> in pom.xml for? The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path Maven error in eclipse (pom.xml) : Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml

Examples related to ojdbc

Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml SQLException: No suitable Driver Found for jdbc:oracle:thin:@//localhost:1521/orcl

Examples related to artifact

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