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

标签 java eclipse oracle maven jar

我已经使用 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/

相关文章:

SQL:如何检查列中的值是否等于行中其他列的任意组合的总和

java - 规范中未定义任何操作!在swagger ui中指定多个路径时

java - iPhone 3Des 加密匹配 Java 和 .NET key 问题,SecretKeySpec?

java - 如何删除eclipse中不需要的jar文件和其他库?

sql - Excel 到具有较大数据集(>2000 条记录)的远程 oracle 数据库。使用支持 FetchSize 的驱动程序存储 proc 调用

oracle - FKs全层级自动生成oracle数据库数据

java - Jhipster Registry 4.0.0异常预打包WAR

java - 执行 native 代码的线程的正常关闭

android - 无法解析或不是 SUPPORTED_ABIS、FLAVOR & VERSION_CODES.LOLLIPOP 的字段

android - 操作系统不适合模拟器 AVD