Missing artifact com.oracle:ojdbc7 in eclipse
Asked Answered
R

5

16

I have imported a Maven Project in Eclipse (EE Developer) and I have in my pom.xml file the following error, “Missing artifact com.oracle:ojdbc7:jar:12.1.0.2″ in this code:

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

I have done so by downloading the ojdbc7.jar and run this command:

mvn install:install-file -Dfile=/Path-to-jar/ojdbc7.jar
-DgroupId=com.oracle 
-DartifactId=ojdbc7 
-Dversion=12.1.0.2 
-Dpackaging=jar 
-DgeneratePom=true

After that, I got as an output BUILD SUCCESS, and if I go to the .m2 folder I see in the com->oracle->ojdbc7 two files called “ojdbc7-12.1.0.1.jar.lastUpdated” and “ojdbc7-12.1.0.1.pom.lastUpdated” but still Eclipse brings me the code into the pom.xml file as an error?!?!?! Can some one help?

Rennold answered 13/8, 2015 at 23:32 Comment(1)
Appears that jar just plain "might not be available" in public maven repo's. Weird. #1075369Impressionable
D
13

This artifact version (12.1.0.2) has been removed to an another dependency.

See: https://mvnrepository.com/artifact/com.oracle/ojdbc7

Try to change the new dependency:

<dependency>
    <groupId>com.oracle.database.jdbc</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>12.2.0.1</version>
</dependency>
Damek answered 22/6, 2020 at 15:24 Comment(1)
it worked. I have issue with following dependency " <version>12.1.0</version> </dependency>", after replacing above, it worked.Sferics
H
4

After successfully running the "mvn install" command right click your Project -> Maven -> Update Project (or Alt+F5).

Hydrometallurgy answered 6/2, 2019 at 10:45 Comment(1)
If its ojdbc7.jar, add <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc7</artifactId> <version>12.1.0</version></dependency> It worked for me. Rather than 12.1.0.1 put 12.1.0.Demosthenes
P
0

I would get rid of those 2 files manually (lastUpdated) then re-run your install command and finally build your project. Those 2 files have been created by mvn as flags to avoid refetching them for a certain amount of time. They certainly have been created prior to your manual install-file command.

Palmapalmaceous answered 13/8, 2015 at 23:42 Comment(2)
Still getting "Missing artifact". But ThanksRennold
After running install, what do you have in your m2 oracle/odbc7 folder?Palmapalmaceous
E
0

I recommend you to follow the instruction given in this link. "http://javabycode.com/build-tools/maven/add-oracle-jdbc-driver-maven.html"

As per your dependency in pom.xml there should be 4 files generated inside "m2repo\com\oracle\ojdbc7\12.1.0.2" folder.

  1. ojdbc7-12.1.0.2.jar
  2. ojdbc7-12.1.0.2.jar.lastUpdated
  3. ojdbc7-12.1.0.2.pom
  4. ojdbc7-12.1.0.2.pom.lastUpdated

But as you are saying you checked for "ojdbc7-12.1.0.1.jar.lastUpdated", that should not be the case. I recommend you to delete your dependency folder and then start from scratch.

Epsomite answered 27/10, 2017 at 9:3 Comment(0)
T
0

Some how the jar is not getting downloaded into the local pc. I opened the maven site https://mvnrepository.com/artifact/com.oracle/ojdbc7/12.1.0.2 and downloaded the required jar and placed it in to the .m2 folder, and the error is gone.

Takamatsu answered 10/4, 2020 at 5:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.