Java 缺少工件 com.oracle:ojdbc6:jar:11.2.0.3

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44238622/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:25:56  来源:igfitidea点击:

Missing artifact com.oracle:ojdbc6:jar:11.2.0.3

javaoraclemaven

提问by Ramesh Kumar Chikoti

enter image description hereI am a beginner to Maven project. In my project, I am getting the error Missing artifact com.oracle:ojdbc6:jar:11.2.0.3, even though the jar was present in my repository at the correct folder. Can anyone help with this, please?

在此处输入图片说明我是 Maven 项目的初学者。在我的项目中,Missing artifact com.oracle:ojdbc6:jar:11.2.0.3即使 jar 存在于我的存储库中正确文件夹中,我也收到错误消息。任何人都可以帮忙吗?

采纳答案by Ramesh Kumar Chikoti

Remove the ojdbc6 folder from the .m2 repository completely and then maven update the project in enclipse that solved my problem

从 .m2 存储库中完全删除 ojdbc6 文件夹,然后 maven 在 enclipse 中更新项目,解决了我的问题

回答by Krzysztof At?asik

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.

不幸的是,由于二进制许可证,Oracle Driver JAR 没有公共存储库,因此您不能将其添加到您的 pom 文件中。

You have to add this jar manually:

您必须手动添加此 jar:

First, you have to download ojdb6.jarfrom hereclick jar (2.6 MB)on the middle of the page.

首先,你必须ojdb6.jar这里下载, 点击 jar (2.6 MB)页面中间。

Then put ojdb6.jarin some folder in your project (let's use lib).

然后ojdb6.jar在您的项目中放入某个文件夹(让我们使用lib)。

Then you have to add this in your dependenciessection in your pom.xml:

然后你必须在你的dependencies部分添加它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:

另一种选择是在您的本地 maven 存储库中安装这个 jar:

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.

你必须选择最适合你的。

回答by Sachin M

<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

如果您使用的是弹簧靴,应该可以解决这个问题

回答by Pratik Roy

Once you face the issue . Check in your maven user settings path . This will be a path something like :

一旦遇到问题。检查您的 Maven 用户设置路径。这将是一条类似于:

C:\Users\ user name\ .m2\repository

C:\Users\用户名\.m2\repository

Open the location and go to oracle\ojdbc6\11.2.0.3folder and put the .jar on that location .Return back to eclipse perform maven update and your issue will be gone.

打开该位置并转到oracle\ojdbc6\11.2.0.3文件夹并将 .jar 放在该位置。返回到 eclipse 执行 maven 更新,您的问题将消失。