我已经使用 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 上收到错误
我对两件事感到困惑
我的 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/