oracle依赖有问题吗?

发布于 2024-12-29 02:53:06 字数 429 浏览 2 评论 0原文

当我尝试使用 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 -

enter image description here

Is there an issue with this dependency or something I'm doing wrong ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

白鸥掠海 2025-01-05 02:53:06

我按照以下步骤解决了(对于版本 10.2.0.4.0):

  1. 将 Maven 的依赖项添加到您的 pom.xml 中。
  2. 下载maven找不到的缺失文件< /a>
  3. 将下载的文件放入存储库:
    .m2\repository\com\oracle\ojdbc14\10.2.0.4.0\
  4. 刷新 pom.xml 错误消息应该消失了。

I followed these steps and solved (for version 10.2.0.4.0):

  1. Add dependency with maven to your pom.
  2. Download the missing file that maven can't find
  3. Put the downloaded file into the repository:
    .m2\repository\com\oracle\ojdbc14\10.2.0.4.0\
  4. Refresh pom.xml and the error message should be gone.
公布 2025-01-05 02:53:06

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.

南七夏 2025-01-05 02:53:06

安装所需的 jar,如下所示:

  1. 将 ojdbc14.jar 复制到 D:\
  2. 进入 D:\ 并执行以下 maven 命令:

D:>mvn install:安装文件 -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

  1. 添加依赖 pom.xml

    <依赖项>
        com.oracle;
        ojdbc14
        <版本>10.2.0.4.0
    
    

详细信息请参阅: http://softwarecave.org/2014/06/14/adding-external-jars-into-maven-project/

Install the required jar as follows:

  1. Copy ojdbc14.jar to D:\
  2. Go to D:\ and execute the following maven command:

D:>mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

  1. add dependency pom.xml

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
        <version>10.2.0.4.0</version>
    </dependency>
    

for detail see : http://softwarecave.org/2014/06/14/adding-external-jars-into-maven-project/

热血少△年 2025-01-05 02:53:06

我采取了手动下载 oracle ojdb14 jar 和 pom 文件的方式,但我没有手动将它们添加到我的本地存储库中,而是使用了 maven:

    § mvn install:install-file -Dfile=ojdbc14-10.2.0.2.jar -DpomFile=ojdbc14-10.2.0.2.0.pom

这确保了它们正确安装在我的本地存储库中
(参见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:

    § mvn install:install-file -Dfile=ojdbc14-10.2.0.2.jar -DpomFile=ojdbc14-10.2.0.2.0.pom

This insured they were correctly installed in my local repo
(see http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)

郁金香雨 2025-01-05 02:53:06

尝试在 oracle Maven 依赖项中正常工作

<repositories>
<!-- Repository for ORACLE ojdbc6. -->
<repository>
    <id>codelds</id>
    <url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>

<dependencies> 
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>

Try this working fine in oracle maven dependency

<repositories>
<!-- Repository for ORACLE ojdbc6. -->
<repository>
    <id>codelds</id>
    <url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>

<dependencies> 
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>

美人骨 2025-01-05 02:53:06

我遇到了同样的问题,这就是解决方法:

  1. 转到 1. https://code.lds .org/nexus/#welcome 并搜索 ojdbc;
  2. 从列表中选择一个版本,复制右侧的 Maven XML 配置并将其粘贴到 pom.xml 中;
  3. 在 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:

  1. go to 1. https://code.lds.org/nexus/#welcome and search for ojdbc;
  2. Select one version from the list, copy the XML configuration for Maven that you will find on the right side and paste it in your pom.xml;
  3. 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>

堇年纸鸢 2025-01-05 02:53:06

为了补充其他答案:通常建议检查用于构建的存储库中是否有可用的工件。如果不是这种情况,您应该考虑运行自己的存储库。当您想在 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.

爱的十字路口 2025-01-05 02:53:06

不要使用石器时代的驱动程序,而应使用最新的 11g 驱动程序。您将其部署到本地 Nexus 实例。

Do NOT use stone-age driver and rather the newest 11g one. Which you will deploy to your local Nexus instance.

久随 2025-01-05 02:53:06

有一个 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/).

流年里的时光 2025-01-05 02:53:06

它对我来说是如何工作的

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

云雾 2025-01-05 02:53:06

下面应该按照这个链接(已于 2016 年 2 月更新)工作。

<dependency>
 <groupId>com.oracle.jdbc</groupId>
 <artifactId>ojdbc7</artifactId>
 <version>12.1.0.2</version>
</dependency>

Below should work as per this link which has been updated on Feb, 2016.

<dependency>
 <groupId>com.oracle.jdbc</groupId>
 <artifactId>ojdbc7</artifactId>
 <version>12.1.0.2</version>
</dependency>
要走就滚别墨迹 2025-01-05 02:53:06

我通过将 jar 放在 .m2 文件夹中并在 pom 中添加标签来解决它

<url>
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
</url>

I solved it by placing the jar in the .m2 folder and in pom adding the tag

<url>
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
</url>
思慕 2025-01-05 02:53:06

我遇到了同样的问题,现在通过在 build.gradle 中添加以下内容来解决它。

repositories {
    mavenCentral()
    jcenter()  // Adding this in repositories resolved the issue
}

compile('com.oracle:ojdbc6:11.2.0.3')`

I had the same problem and its working now by adding below in build.gradle.

repositories {
    mavenCentral()
    jcenter()  // Adding this in repositories resolved the issue
}

compile('com.oracle:ojdbc6:11.2.0.3')`
丶情人眼里出诗心の 2025-01-05 02:53:06

这些步骤对我有用。我的机器上有java 1.8和maven 3.6。 java 1.7 的相同过程失败

  1. 从 oracle 网站下载相关的 jar 文件(链接如下所示)
    http://www.oracle.com/technology/software/ tech/java/sqlj_jdbc/index.html

  2. 将 jar 文件提取到计算机上的特定文件夹

  3. 确保您有 maven 并且上java通过在终端上运行 mvn -version 命令来更改您的路径(顺便说一句,我使用的是 Windows 10。

    C:\Windows\system32>mvn -version

如果一切正常,您将得到类似的内容

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10       -24T20:41:47+02:00)
Maven home: C:\apache-maven-3.6.0\bin\..
  1. 通过运行以下命令将下载的 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

  1. jar 文件更新到本地存储库

请参阅下面的示例输出:

    [INFO] Scanning for projects...
    Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
    Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 1.7 kB/s)INFO] Installing C:\Users\Mwagiru\Desktop\Projects\BPR\ojdbc-full\OJDBC-Full\ojdbc7.jar to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.jar
[INFO] Installing C:\Users\Mwagiru\AppData\Local\Temp\mvninstall581357638187646

    6278.pom to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  27.711 s
    [INFO] Finished at: 2018-11-21T13:08:37+02:00
    [INFO] ------------------------------------------------------------------------
  1. 您现在可以通过将 Oracle 依赖项添加到您的 pom 文件来将其添加到您的项目中。请参阅下面的示例。

    <依赖项>
        com.oracle;
        ojdbc7
        <版本>12.1.0
    
    

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

  1. Download the relevant jar files from the oracle website (Link shown below)
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

  2. Extract the jar files to a specific folder on your machine

  3. 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 .

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10       -24T20:41:47+02:00)
Maven home: C:\apache-maven-3.6.0\bin\..
  1. 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)

  1. Maven will fetch any plugins needed and update specified ojdbc jar file to your local repository

See sample out put below :

    [INFO] Scanning for projects...
    Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
    Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 1.7 kB/s)INFO] Installing C:\Users\Mwagiru\Desktop\Projects\BPR\ojdbc-full\OJDBC-Full\ojdbc7.jar to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.jar
[INFO] Installing C:\Users\Mwagiru\AppData\Local\Temp\mvninstall581357638187646

    6278.pom to C:\Users\Mwagiru\.m2\repository\com\oracle\ojdbc7\12.1.0\ojdbc7-12.1.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  27.711 s
    [INFO] Finished at: 2018-11-21T13:08:37+02:00
    [INFO] ------------------------------------------------------------------------
  1. You may now add oracle depedency to your projects by adding it to your pom files. See sample below.

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0</version>
    </dependency>
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文