缺少神器com.oracle:ojdbc14:jar:10.2.0.1.0

bej*_*hia 9 java eclipse oracle maven ojdbc

我正在尝试为ojdbc14添加依赖项pom.xml.我在maven的本地存储库中添加ojdbc14.jar的步骤:

  1. 创建一个新项目
  2. 移动到pom.xml文件位于命令提示符中的特定文件夹.
  3. 执行命令mvn clean.
  4. 执行命令:

    mvn install:install-file -Dfile = ojdbc14.jar -DgroupId = com.oracle -DartifactId = oracle -Dversion = 10.2.0.1.0 -Dpackaging = jar -DgeneratePom = true

在此之后我获得了构建成功消息

我已经在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\10.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:\>
Run Code Online (Sandbox Code Playgroud)

我的本地代理是C:\ Users\Dhia\Desktop\eclipse jee,当在eclipse oracle存储库中打开.com时没有出现

添加com.oracle ojdbc14 10.2.0.1.0时

我的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>
Run Code Online (Sandbox Code Playgroud)

我的pom.xml文件中出现错误:缺少工件com.oracle:ojdbc14:jar:10.2.0.1.0,我无法在本地存储库中看到ojdbc14.jar文件.我遵循的步骤是否有任何问题.请帮帮我.

谢谢

Rho*_*kai 12

这不能直接安装,因为Oracle已经提供了一些许可和协议.所以我们必须手动下载它并将其安装到项目中.使用此链接选择所需的版本并下载ojdbc14.jar文件.您必须拥有Oracle帐户才能下载它.

然后打开命令提示符.转到文件下载位置.然后输入以下代码.

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.x.x.x -Dpackaging=jar -Dfile=ojdbc14.jar -DgeneratePom=true
Run Code Online (Sandbox Code Playgroud)

使用您需要的版本填写x.然后右键单击您的项目> Maven>更新项目.

这将解决问题.


Sto*_*ica 2

根据 的输出mvn install:install-filejar已正确安装在本地 Maven 存储库中。如果您将其添加到您的pom.xml(在该<dependencies>部分内),您的项目应该找到该 jar:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.1.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

如果您仍然遇到问题,请分享您的pom.xml错误输出。