gpt4 book ai didi

java - eclipse 中的 pom.xml 中缺少 Artifact com.oracle :ojdbc5:jar:11. 2.0.1 错误

转载 作者:行者123 更新时间:2023-11-30 08:14:06 30 4
gpt4 key购买 nike

我已经使用 maven 在 Eclipse 中创建了一个项目。我的 pom.xml 依赖项中出现错误,依赖项如下所示。

<dependency> 
<groupId>com.oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>11.2.0.1</version>
<scope>provided</scope>
</dependency>

我得到:

Missing artifact com.oracle:ojdbc5:jar:11.2.0.1

我自己在stackoverflow上看到了一个解决方案,那-

due to Oracle license restriction, there are no public repositories that provide ojdbc jar. you need to download it and install in your local repository. Get jar from Oracle and install it in your local maven repository using

mvn install:install-file -Dfile={path/to/your/ojdbc.jar} -DgroupId=com.oracle 
-DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

上面的命令。我执行了以下命令,更改了我的 ojdbc.jar 的路径。

mvn install:install-file -Dfile={
C/monitoring-workspace/ojdbc5.jar} -DgroupId=com.oracle
-DartifactId=ojdbc5 -Dversion=11.2.0.1-Dpackaging=jar

但我在 cmd 上收到一个错误 enter image description here

我对两件事感到困惑

  • 我的 oracle 文件夹本身有 ojdbc5 和 ojdbc6 jar 那我为什么需要安装ojdbc5

  • 安装ojdbc-the时我需要提供的路径应该是什么我需要安装的位置或我保存 ojdbc5 jar 的路径。

最佳答案

我看到你提到了mykong文章。问题是新线。您必须确保在命令提示符下一行中得到它。

mvn install:install-file -Dfile=C:/monitoring-workspace/ojdbc5.jar -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.1 -Dpackaging=jar

关于java - eclipse 中的 pom.xml 中缺少 Artifact com.oracle :ojdbc5:jar:11. 2.0.1 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29693510/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com