oracle依赖有问题吗?
当我尝试使用 oracle 依赖项时 -
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
我收到编译时构建错误 - “缺少工件 com.oracle:ojdbc14:jar:10.2.0.4.0”。 当我将鼠标悬停在附加图像中的错误标记(左侧)上时,会显示此错误 -
是否存在问题有这种依赖性还是我做错了什么?
When I try to use the oracle dependency -
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
I receive a compile time build error - "Missing artifact com.oracle:ojdbc14:jar:10.2.0.4.0".
This error is displayed when I hover over error marker (left of ) in attached image -
Is there an issue with this dependency or something I'm doing wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
我按照以下步骤解决了(对于版本 10.2.0.4.0):
.m2\repository\com\oracle\ojdbc14\10.2.0.4.0\
pom.xml
错误消息应该消失了。I followed these steps and solved (for version 10.2.0.4.0):
.m2\repository\com\oracle\ojdbc14\10.2.0.4.0\
pom.xml
and the error message should be gone.maven中央存储库中没有这样的工件: http://repo1 .maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0(仅
pom
)。我想由于一些许可问题,您必须从 JDBC 手动下载文件、SQLJ、Oracle JPublisher 和通用连接池 (UCP) 下载页面。
There is no such artifact in maven central repository: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0 (only
pom
).I guess due to some licensing issues you must download the file manually from JDBC, SQLJ, Oracle JPublisher and Universal Connection Pool (UCP) download page.
安装所需的 jar,如下所示:
添加依赖 pom.xml
详细信息请参阅: http://softwarecave.org/2014/06/14/adding-external-jars-into-maven-project/
Install the required jar as follows:
add dependency pom.xml
for detail see : http://softwarecave.org/2014/06/14/adding-external-jars-into-maven-project/
我采取了手动下载 oracle ojdb14 jar 和 pom 文件的方式,但我没有手动将它们添加到我的本地存储库中,而是使用了 maven:
这确保了它们正确安装在我的本地存储库中
(参见http://maven.apache.org/guides /mini/guide-3rd-party-jars-local.html)
I took the route of manually downloading the oracle ojdb14 jar and pom file, but instead of manually adding them to my local repo, I used maven:
This insured they were correctly installed in my local repo
(see http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)
尝试在 oracle Maven 依赖项中正常工作
Try this working fine in oracle maven dependency
我遇到了同样的问题,这就是解决方法:
在 pom.xml 中添加新存储库:
<代码><存储库>;
codelds
https://code.lds.org/nexus/content/groups/main-repo
<存储库>
I had the same problem and that's how you can fix it:
Add a new repository in your pom.xml:
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>
为了补充其他答案:通常建议检查用于构建的存储库中是否有可用的工件。如果不是这种情况,您应该考虑运行自己的存储库。当您想在 Maven 构建中使用自己的库时,这已经得到了回报。
To complement the other answer: It is generally advisable to check if an artifact is available in the repositories you use for your build. If this is not the case, you should consider running your own repository. This already pays off as soon as you want to use your own libraries with maven builds.
不要使用石器时代的驱动程序,而应使用最新的 11g 驱动程序。您将其部署到本地 Nexus 实例。
Do NOT use stone-age driver and rather the newest 11g one. Which you will deploy to your local Nexus instance.
有一个 repo 提供了该 jar。在 SBT 中添加一个与此类似的解析器:
“oracle 驱动程序存储库”位于“http://dist.codehaus.org/mule/dependency/maven2< /a>”
和依赖项:
"oracle" % "ojdbc14" % "10.2.0.2"
你可以用maven做同样的事情。 pom.xml 和 jar 可用(http://dist.xml 和 jar ) codehaus.org/mule/dependencies/maven2/oracle/ojdbc14/10.2.0.2/)。
There is one repo that provides the jar. In SBT add a resolver similar to this:
"oracle driver repo" at "http://dist.codehaus.org/mule/dependencies/maven2"
and a dependency:
"oracle" % "ojdbc14" % "10.2.0.2"
You can do the same with maven. pom.xml and jar are available (http://dist.codehaus.org/mule/dependencies/maven2/oracle/ojdbc14/10.2.0.2/).
它对我来说是如何工作的
1)下载所需的 jar
2)使用mvn命令安装Jar
3)在pom.xml文件中进行更改\使用依赖项FE进行更改
How it worked for me
1) Downloaded required jar
2) Installed Jar using mvn command
3) Make changes in pom.xml file \ use dependency FE to make changes
下面应该按照这个链接(已于 2016 年 2 月更新)工作。
Below should work as per this link which has been updated on Feb, 2016.
我通过将 jar 放在 .m2 文件夹中并在 pom 中添加标签来解决它
I solved it by placing the jar in the .m2 folder and in pom adding the tag
我遇到了同样的问题,现在通过在 build.gradle 中添加以下内容来解决它。
I had the same problem and its working now by adding below in build.gradle.
这些步骤对我有用。我的机器上有java 1.8和maven 3.6。 java 1.7 的相同过程失败
从 oracle 网站下载相关的 jar 文件(链接如下所示)
http://www.oracle.com/technology/software/ tech/java/sqlj_jdbc/index.html
将 jar 文件提取到计算机上的特定文件夹
确保您有 maven 并且上java通过在终端上运行 mvn -version 命令来更改您的路径(顺便说一句,我使用的是 Windows 10。
C:\Windows\system32>mvn -version
如果一切正常,您将得到类似的内容
通过运行以下命令将下载的 jar 文件添加到您的 Maven 存储库。
C:\Windows\system32>mvn install:install-file -Dfile=C:\\Users\\Mwagiru\\Desktop\\Projects\\BPR\ojdbc-full\\OJDBC-Full\\ ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar -
(请记住使用 Maven 将获取所需的任何插件并将指定的ojdbc
请参阅下面的示例输出:
您现在可以通过将 Oracle 依赖项添加到您的 pom 文件来将其添加到您的项目中。请参阅下面的示例。
These steps worked for me. I have java 1.8 and maven 3.6 on my machine. The same process failed with java 1.7
Download the relevant jar files from the oracle website (Link shown below)
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
Extract the jar files to a specific folder on your machine
Ensure you have maven AND java on your path by running mvn -version command on your terminal (Im using Windows 10 btw.
C:\Windows\system32>mvn -version
You will get something like this if all is fine .
Add the downloaded jar file to your maven repository by running the command below.
C:\Windows\system32>mvn install:install-file -Dfile=C:\\Users\\Mwagiru\\Desktop\\Projects\\BPR\ojdbc-full\\OJDBC-Full\\ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar -
(Remember to update the command with the location where you unzipped your ojdbc jar file)
See sample out put below :
You may now add oracle depedency to your projects by adding it to your pom files. See sample below.