Unfortunately, due to the binary license, there is no public repository with the Oracle Driver JAR, so you cannot just add it to your pom file.
You have to add this jar manually:
First, you have to download ojdbc6.jar
from here click jar (2.6 MB)
on the middle of the page.
Then put ojdbc6.jar
in some folder in your project (let's use lib
).
Then you have to add this in your dependencies
section in your pom.xml
:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>11.2.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/ojdbc6.jar</systemPath>
</dependency>
Another option is to install this jar in your local maven repository:
mvn install:install-file -Dfile=path/to/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
And then you will be able to reference this dependency like this:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
You have to choose what's best for you.
从 .m2 存储库中完全删除 ojdbc6 文件夹,然后 maven 在 enclipse 中更新项目,解决了我的问题
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
Should solve the issue if you are using spring boot
Once you face the issue . Check in your maven user settings path . This will be a path something like :
C:\\Users\\ user name \\ .m2\\repository
Open the location and go to oracle\\ojdbc6\\11.2.0.3 folder and put the .jar on that location .Return back to eclipse perform maven update and your issue will be gone.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.