I am trying to add ojdbc dependency in my pom.xml file to connect with Oracle database.
As shown below, this jar is available in maven repository.
But, after adding it pom.xml file, it's throwing below error. My settings are on auto import, so it should import it automatically.
Error:
com.oracle.ojdbc8.12.2.0.1.0 not found..
I am using Intellij IDEA and java version is 1.8.
Update:
After cleaning and compiling, I got to to know the actual root cause. My repository is set as below :
<repositories>
<repository>
<id>confluent</id>
<url>http://packages.confluent.io/maven/</url>
</repository>
</repositories>
So, it's trying to look for ojdbc driver in this repository and not able to find it(my guess). I can't remove the above repository as it is required for other dependency. So, I would like to know how can I force ojdbc dependency to look into maven instead of io.confluent repository. Do I have to set two repositories?
Error :
[ERROR] Failed to execute goal on project PaymentEngine: Could not resolve dependencies for project com.example.test:PaymentEngine:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc8:jar:12.2.0.1.0 in http://packages.confluent.io/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of confluent has elapsed or updates are forced -> [Help 1]
Please note that mvnrepository has nothing to do with MavenCentral.
When you find an artifact there, it does not mean that Maven will find it in MavenCentral.
Instead, you need to figure out a repository from which you can get the desired jar and then add that repository to your <repositories>
.
For the specific jar, this might be difficult, see here (as already suggested by Ben R.):
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments