Java 缺少工件 com.oracle:ojdbc14:jar:10.2.0.1.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28787495/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Missing artifact com.oracle:ojdbc14:jar:10.2.0.1.0
提问by beji dhia
I am trying to add dependency for ojdbc14 in pom.xml
.
Steps I followed for adding ojdbc14.jar in local repository of maven:
我正在尝试为 .ojdbc14 添加依赖项pom.xml
。我在 maven 的本地存储库中添加 ojdbc14.jar 遵循的步骤:
- Create a new project
- move to that particular folder where is pom.xml file was located in command prompt.
- execute the command
mvn clean
. execute the command:
mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=oracle -Dversion=10.2.0.1.0 -Dpackaging=jar -DgeneratePom=true
- 创建一个新项目
- 移动到命令提示符中 pom.xml 文件所在的特定文件夹。
- 执行命令
mvn clean
。 执行命令:
mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=oracle -Dversion=10.2.0.1.0 -Dpackaging=jar -DgeneratePom=true
after this I got a build success message
在此之后,我收到一条构建成功消息
I have updated the global and local repository in Eclipse > Maven Repositories
我已经在 Eclipse > Maven Repositories 中更新了全局和本地存储库
C:\> mvn install:install-file -Dfile="C:\Users\Dhia\Desktop\Nouveau dossier\ojdb
c14.jar" -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackag
ing=jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] Installing C:\Users\Dhia\Desktop\Nouveau dossier\ojdbc14.jar to C:\Users\
Dhia\.m2\repository\com\oracle\ojdbc14.2.0.1.0\ojdbc14-10.2.0.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.460s
[INFO] Finished at: Sat Feb 28 22:44:13 CET 2015
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
C:\>
my local repoitory is C:\Users\Dhia\Desktop\eclipse jee and when opening .com in eclipse oracle repository doesn't appear
我的本地存储库是 C:\Users\Dhia\Desktop\eclipse jee 并且在 eclipse oracle 存储库中打开 .com 时没有出现
when adding com.oracle ojdbc14 10.2.0.1.0
添加 com.oracle ojdbc14 10.2.0.1.0 时
my pom.txt
我的 pom.txt
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>b</groupId>
<artifactId>b</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>b</name>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
</repository>
<!--
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
-->
</repositories>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.8.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-faces</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.1.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.10</version>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.14</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.10</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.3.02</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.8.Final</version>
</dependency>
</dependencies>
</project>
I got error in my pom.xml file :Missing artifact com.oracle:ojdbc14:jar:10.2.0.1.0, and I am not able to see the ojdbc14.jar file in my local repository. Is there any thing wrong in the steps I followed. Please help me out.
我的 pom.xml 文件中出现错误:缺少工件 com.oracle:ojdbc14:jar:10.2.0.1.0,并且我无法在本地存储库中看到 ojdbc14.jar 文件。我遵循的步骤有什么问题吗?请帮帮我。
Thanks
谢谢
回答by janos
Based on the output of mvn install:install-file
, the jar
was correctly installed in your local maven repository. If you add this to your pom.xml
(inside the <dependencies>
section), your project should find the jar:
根据 的输出mvn install:install-file
,jar
已正确安装在您的本地 Maven 存储库中。如果您将此添加到您的pom.xml
(在该<dependencies>
部分内),您的项目应该会找到 jar:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.1.0</version>
</dependency>
If you're still experiencing problems,
please share your pom.xml
and the error output.
如果您仍然遇到问题,请分享您pom.xml
的错误输出。
回答by nishant
The XML for version com.oracle:ojdbc14:jar:10.2.0.1.0 is missing from the central repository. So i think this version will create problem for many more people
中央存储库中缺少 com.oracle:ojdbc14:jar:10.2.0.1.0 版本的 XML。所以我认为这个版本会给更多人带来问题
回答by Rhokai
This can't be directly install because Oracle has put some license and agreements. So we have to download it manually and install it to the project. Use this linkto choose the version you need and download the ojdbc14.jar file. You must have an Oracle account to download it.
这个不能直接安装,因为Oracle已经放了一些许可和协议。所以我们必须手动下载并安装到项目中。使用此链接选择您需要的版本并下载 ojdbc14.jar 文件。您必须拥有 Oracle 帐户才能下载它。
Then open the command prompt. Go to the file download location. Then enter below code.
然后打开命令提示符。转到文件下载位置。然后输入下面的代码。
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.x.x.x -Dpackaging=jar -Dfile=ojdbc14.jar -DgeneratePom=true
Fill the x using your needed version. Then right click on your project >Maven>Update Project.
使用您需要的版本填写 x。然后右键单击您的项目>Maven>更新项目。
This will solve the problem.
这将解决问题。
回答by The PowerHouse
There is no such artifact in maven central repository: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0(only pom).
maven 中央存储库中没有这样的工件:http: //repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.4.0(仅 pom)。
Please refer Is there an issue with the oracle dependency?
回答by Nara
This might be because of your maven settings.xml
file. If you don't configure your local repo in settings.xml
maven default repo will be Default: ${user.home}/.m2/repository
. And you need to configure same maven settings in your IDE.
这可能是因为您的 mavensettings.xml
文件。如果你没有在settings.xml
maven 中配置你的本地 repo,默认的 repo 将是 Default: ${user.home}/.m2/repository
. 并且您需要在 IDE 中配置相同的 Maven 设置。
回答by shikha singh
Manually downloading the ojdbc14 jar worked for me :)
手动下载 ojdbc14 jar 对我有用:)