Maven仓库添加Oracle JDBC驱动

       由于Oracle授权问题,Maven3不提供Oracle JDBC driver,为了在Maven项目中应用Oracle JDBC driver,必须手动添加到本地仓库。

一.获得Oracle JDBC Driver

1.通过Oracle官方网站下载相应版本:http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

2.通过Oracle的安装目录获得,位置在“{ORACLE_HOME}\jdbc\lib\ojdbc14.jar”

二.手动安装安装

手动安装请参考另一篇文章:maven3 手动安装本地jar到仓库

或者命令如下:

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

 

三.pom.xml文件中添加引用

<dependencies>
    <!-- 添加oracle jdbc driver -->  
    <dependency>    
        <groupId>com.oracle</groupId>    
        <artifactId>ojdbc14</artifactId>    
        <version>10.2.0.4.0</version>
    </dependency>
  </dependencies>

 

参考原文:http://www.cnblogs.com/leiOOlei/p/3380568.html

猜你喜欢

转载自longfor5.iteye.com/blog/2163994