0

I'm switching a maven project's db from MySQL to Oracle. I have this dependency in my pom.xml:

<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc14 -->
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.4.0</version>
</dependency>

But IntelliJ's maven view shows red squigglies on that dependency and mvn clean install gives me:

Could not resolve dependencies for project com.example:polls:jar:0.0.1-SNAPSHOT: Failure to find com.oracle:ojdbc6:jar:11.2.0.1.0 in https://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 -> [Help 1]

So per this advice, I did a force (mvn clean install -U). But that gives me:

Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.pom
[WARNING] The POM for com.oracle:ojdbc6:jar:11.2.0.1.0 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.jar

... even though my .m2 does contain that dependency:

enter image description here

So why does my project not build? Is there some reason Oracle jars are not accessible via maven central?

Woodchuck
  • 3,869
  • 2
  • 39
  • 70
  • Hi, could you print the content of the `pom.xml`? The artifact your giving does not exist (anymore?) on maven central, so it can only rely on the artifact in your local repository, maybe it is invalid? – ebigeon Mar 17 '19 at 19:29
  • Interesting. Hadn't noticed that version is not on maven central. Maybe my organization hosts a copy of it for our projects to access. But interestingly, even if I put a version of Oracle JDBC Driver that's supposedly current, I get same error: Failure to find com.oracle:ojdbc14:jar:10.2.0.4.0. – Woodchuck Mar 17 '19 at 19:53
  • Oracle OJDBC Drivers are not in Central If you have found one which is there by accident. Only use your own internal repository manager... – khmarbaise Mar 17 '19 at 20:11
  • @khmarbaise, out of curiosity, is there a specific reason they shouldn't be on maven central? (Though anyway I agree it is best to use your own repository manager). – ebigeon Mar 17 '19 at 21:21
  • Yes. The License of the OJDBC Drivers of Oracle do not allow that... – khmarbaise Mar 18 '19 at 05:45
  • @khmarbaise, do you know if that's documented somewhere? It would explain what I’m seeing, but raises the question of why they’re listed in mvnrepository, etc. – Woodchuck Mar 18 '19 at 14:17

1 Answers1

0

It turns out Oracle JDBC drivers need to be obtained from the "Oracle Maven Repository". There's lots of guidance on that, which I guess I missed at first. They can also be downloaded directly.

Woodchuck
  • 3,869
  • 2
  • 39
  • 70