Is there an issue with the oracle dependency?
Asked Answered
E

14

29

When I try to use the oracle dependency -

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.4.0</version>
</dependency>

I receive a compile time build error - "Missing artifact com.oracle:ojdbc14:jar:10.2.0.4.0". This error is displayed when I hover over error marker (left of ) in attached image -

enter image description here

Is there an issue with this dependency or something I'm doing wrong ?

Ember answered 25/1, 2012 at 17:16 Comment(2)
What IDE do you use? Can you build on the command line, i.e. by calling Maven directly?Abscissa
I am using m2eclipse. But I can also build from the command lineEmber
M
23

There is no such artifact in maven central repository: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0 (only pom).

I guess due to some licensing issues you must download the file manually from JDBC, SQLJ, Oracle JPublisher and Universal Connection Pool (UCP) download page.

Multistage answered 25/1, 2012 at 17:27 Comment(5)
Perhaps it pays off to run a local maven repository as a mirror. This enables you to include artifacts that are not available in "official" repos in your own repo.Abscissa
Why would a POM file exist if there no such available jar file, what is the use ? Is it so as "migu" states, I can host the file in my own repository using a standardized pom file. How is a pom file entry with no corresponding artifact/jar useful ?Ember
@migu: maybe the authors of the artifact wanted to suggest/enforce naming convention of groupId/artifactId while the JAR itself has to be downloaded manually (and uploaded with suggested naming?) Still, this is unexpectedMultistage
i have the same error, i downloaded the file manually and placed next to the corresponding pom in the local maven directory, but the error wont go away. anything else i need to do?Laura
There are lot of items in repositories that only host the pom. Reason is that you can use poms to calculate dependencies, work out parent pom relationships etc. This is needed time to time even when actual .jar cannot be provided for whichever reason.Ullund
O
27

I followed these steps and solved (for version 10.2.0.4.0):

  1. Add dependency with maven to your pom.
  2. Download the missing file that maven can't find
  3. Put the downloaded file into the repository: .m2\repository\com\oracle\ojdbc14\10.2.0.4.0\
  4. Refresh pom.xml and the error message should be gone.
Oscitancy answered 4/8, 2013 at 11:42 Comment(0)
M
23

There is no such artifact in maven central repository: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0 (only pom).

I guess due to some licensing issues you must download the file manually from JDBC, SQLJ, Oracle JPublisher and Universal Connection Pool (UCP) download page.

Multistage answered 25/1, 2012 at 17:27 Comment(5)
Perhaps it pays off to run a local maven repository as a mirror. This enables you to include artifacts that are not available in "official" repos in your own repo.Abscissa
Why would a POM file exist if there no such available jar file, what is the use ? Is it so as "migu" states, I can host the file in my own repository using a standardized pom file. How is a pom file entry with no corresponding artifact/jar useful ?Ember
@migu: maybe the authors of the artifact wanted to suggest/enforce naming convention of groupId/artifactId while the JAR itself has to be downloaded manually (and uploaded with suggested naming?) Still, this is unexpectedMultistage
i have the same error, i downloaded the file manually and placed next to the corresponding pom in the local maven directory, but the error wont go away. anything else i need to do?Laura
There are lot of items in repositories that only host the pom. Reason is that you can use poms to calculate dependencies, work out parent pom relationships etc. This is needed time to time even when actual .jar cannot be provided for whichever reason.Ullund
R
13

Install the required jar as follows:

  1. Copy ojdbc14.jar to D:\
  2. Go to D:\ and execute the following maven command:

D:>mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

  1. add dependency pom.xml

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
        <version>10.2.0.4.0</version>
    </dependency>
    

for detail see : http://softwarecave.org/2014/06/14/adding-external-jars-into-maven-project/

Rena answered 11/12, 2014 at 6:27 Comment(5)
Tried everything else and only this WORKED! Thank you.Holliehollifield
For license reasons Oracle does not publish its drivers on Maven Central. First download the file ojdbc14.jar (by ex) from Oracle.com. Then If you do a cd in the directory where the jar was downloaded you can run exactly the same command in Linux and Windows. mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jarEzar
After you have executed mvn install you will find the file ojdbc14-10.2.0.4.0.jar into the local repository.(.m2/repository/com/oracle/ojdbc14/10.2.0.4.0)Ezar
My pom.xml had groupId com.oracle.jdbc, not com.oracle. After making the necessary changes, it worked!Orthodoxy
Why does it has to be D:\? It could be any directory.Paez
C
4

I took the route of manually downloading the oracle ojdb14 jar and pom file, but instead of manually adding them to my local repo, I used maven:

    § mvn install:install-file -Dfile=ojdbc14-10.2.0.2.jar -DpomFile=ojdbc14-10.2.0.2.0.pom

This insured they were correctly installed in my local repo (see http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)

Claude answered 21/11, 2013 at 16:23 Comment(0)
U
3

Try this working fine in oracle maven dependency

<repositories>
<!-- Repository for ORACLE ojdbc6. -->
<repository>
    <id>codelds</id>
    <url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>

<dependencies> 
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>

Underscore answered 17/6, 2015 at 7:31 Comment(1)
I've search for the repository you have mentioned in the example. Well it reveals to be the "The Church of Jesus Christ of Latter-day Saints" ... mmmhhh, it's not a trustful source.Inheritor
K
2

I had the same problem and that's how you can fix it:

  1. go to 1. https://code.lds.org/nexus/#welcome and search for ojdbc;
  2. Select one version from the list, copy the XML configuration for Maven that you will find on the right side and paste it in your pom.xml;
  3. Add a new repository in your pom.xml:

    <repositories> <repository> <id>codelds</id> <url>https://code.lds.org/nexus/content/groups/main-repo</url> </repository> </repositories>

Kloster answered 21/9, 2015 at 8:59 Comment(0)
A
1

To complement the other answer: It is generally advisable to check if an artifact is available in the repositories you use for your build. If this is not the case, you should consider running your own repository. This already pays off as soon as you want to use your own libraries with maven builds.

Abscissa answered 25/1, 2012 at 17:49 Comment(0)
G
0

Do NOT use stone-age driver and rather the newest 11g one. Which you will deploy to your local Nexus instance.

Gossipry answered 4/8, 2013 at 11:57 Comment(0)
L
0

There is one repo that provides the jar. In SBT add a resolver similar to this: "oracle driver repo" at "http://dist.codehaus.org/mule/dependencies/maven2"

and a dependency: "oracle" % "ojdbc14" % "10.2.0.2"

You can do the same with maven. pom.xml and jar are available (http://dist.codehaus.org/mule/dependencies/maven2/oracle/ojdbc14/10.2.0.2/).

Loralorain answered 5/9, 2013 at 21:1 Comment(1)
The site is not available.Turbo
A
0

How it worked for me

1) Downloaded required jar 2) Installed Jar using mvn command 3) Make changes in pom.xml file \ use dependency FE to make changes

Attribute answered 4/1, 2016 at 11:21 Comment(0)
K
0

Below should work as per this link which has been updated on Feb, 2016.

<dependency>
 <groupId>com.oracle.jdbc</groupId>
 <artifactId>ojdbc7</artifactId>
 <version>12.1.0.2</version>
</dependency>
Katheykathi answered 2/8, 2016 at 6:49 Comment(0)
Z
0

I solved it by placing the jar in the .m2 folder and in pom adding the tag

<url>
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
</url>
Zindman answered 4/3, 2017 at 12:8 Comment(0)
R
0

I had the same problem and its working now by adding below in build.gradle.

repositories {
    mavenCentral()
    jcenter()  // Adding this in repositories resolved the issue
}

compile('com.oracle:ojdbc6:11.2.0.3')`
Romanic answered 19/5, 2018 at 13:44 Comment(0)
L
0

These steps worked for me. I have java 1.8 and maven 3.6 on my machine. The same process failed with java 1.7

  1. Download the relevant jar files from the oracle website (Link shown below) http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

  2. Extract the jar files to a specific folder on your machine

  3. Ensure you have maven AND java on your path by running mvn -version command on your terminal (Im using Windows 10 btw.

    C:\Windows\system32>mvn -version

You will get something like this if all is fine .

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10       -24T20:41:47+02:00)
Maven home: C:\apache-maven-3.6.0\bin\..
  1. Add the downloaded jar file to your maven repository by running the command below.

    C:\Windows\system32>mvn install:install-file -Dfile=C:\\Users\\Mwagiru\\Desktop\\Projects\\BPR\ojdbc-full\\OJDBC-Full\\ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar -

(Remember to update the command with the location where you unzipped your ojdbc jar file)

  1. Maven will fetch any plugins needed and update specified ojdbc jar file to your local repository

See sample out put below :

    [INFO] Scanning for projects...
    Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
    Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 1.7 kB/s)INFO] Installing C:\Users\Mwagiru\Desktop\Projects\BPR\ojdbc-full\OJDBC-Full\ojdbc7.jar to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.jar
[INFO] Installing C:\Users\Mwagiru\AppData\Local\Temp\mvninstall581357638187646

    6278.pom to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  27.711 s
    [INFO] Finished at: 2018-11-21T13:08:37+02:00
    [INFO] ------------------------------------------------------------------------
  1. You may now add oracle depedency to your projects by adding it to your pom files. See sample below.

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0</version>
    </dependency>
    
Labor answered 21/11, 2018 at 16:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.