简体   繁体   English

eclipse中pom.xml中缺少工件com.oracle:ojdbc5:jar:11.2.0.1错误

[英]Missing artifact com.oracle:ojdbc5:jar:11.2.0.1 error in pom.xml in eclipse

I have created a project in Eclipse using maven. 我已经使用maven在Eclipse中创建了一个项目。 I am getting an error in my pom.xml in dependency, the dependency look like this. 我在依赖项的pom.xml中遇到错误,依赖项看起来像这样。

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

I am getting: 我正进入(状态:

Missing artifact com.oracle:ojdbc5:jar:11.2.0.1 缺少工件com.oracle:ojdbc5:jar:11.2.0.1

I saw a solution in stackoverflow it self, That- 我在自己的stackoverflow中看到了一个解决方案,那就是-

due to Oracle license restriction, there are no public repositories that provide ojdbc jar. 由于Oracle许可证限制,没有提供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 从Oracle获取jar并使用以下命令将其安装在本地Maven存储库中

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

the above command. 上面的命令。 I executed the bellow command changing the path to my ojdbc.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

but I am getting an error on cmd that 但是我在cmd上遇到一个错误 在此处输入图片说明

I am confused in two things 我对两件事感到困惑

  • My oracle folder it self has ojdbc5 and ojdbc6 jar then why do I need to install ojdbc5 我的oracle文件夹本身具有ojdbc5和ojdbc6 jar,那么为什么我需要安装ojdbc5

  • What should be the path I need to provide while installing ojdbc-the where I need to install or the path where I have kept ojdbc5 jar. 我应该在安装ojdbc时提供的路径是什么-我需要安装的路径还是保留ojdbc5 jar的路径。

I see you have referred to mykong article. 我看到您提到了mykong文章。 The problem is new lines. 问题是换行。 You have to make sure that you got it in one line in the command prompt. 您必须确保在命令提示符下将它放在一行中。

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

ojdbc6.jar - Classes for use with JDK 1.6. ojdbc6.jar-与JDK 1.6一起使用的类。 or newer 或更新的
ojdbc5.jar - Classes for use with JDK 1.5. ojdbc5.jar-与JDK 1.5一起使用的类。
you need only one of them 你只需要其中之一

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM