How To Add Oracle JDBC Driver In Your Maven Local Repository
来源:互联网 发布:淘宝怎么上代购保健品 编辑:程序博客网 时间:2024/06/06 07:28
Due to Oracle license restriction, there is NO public Maven repository provides Oracle JDBC driver. To use Oracle jdbc drive with Maven, you have to install it manually into your Maven local repository.
Here’s a guide to show you how to add an Oracle JDBC driver (“ojdbc6.jar“) into your Maven local repository, and also how to reference it in pom.xml
.
1. Get Oracle JDBC Driver
Two ways to get the Oracle jdbc driver :
- Oracle.com
- Oracle database installed folder, for example, “{ORACLE_HOME}\jdbc\lib\ojdbc6.jar
2. Install It
To install your Oracle jdbc driver, issue following command :
mvn install:install-file -Dfile={Path/to/your/ojdbc.jar} -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jarSee following full example :
D:\>mvn install:install-file -Dfile=D:\app\mkyong\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar[INFO] Scanning for projects...[INFO][INFO] ------------------------------------------------------------------------[INFO] Building Maven Stub Project (No POM) 1[INFO] ------------------------------------------------------------------------[INFO][INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---[INFO] Installing D:\app\mkyong\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar to D:\maven\repo\com\oracle\ojdbc6\11.2.0\ojdbc6-11.2.0.jar[INFO] Installing C:\Users\mkyong\AppData\Local\Temp\mvninstall9153984116424557894.pom to D:\maven\repo\com\oracle\ojdbc6\11.2.0\ojdbc6-11.2.0.pom[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 2.279s[INFO] Finished at: Thu Apr 21 19:56:37 SGT 2011[INFO] Final Memory: 2M/4M[INFO] ------------------------------------------------------------------------Done, ojdbc6.jar is installed in your Maven local repository.
3. pom.xml
Now, you can reference it by declares following Oracle details in your pom.xml
.
File : pom.xml
<project ...> <dependencies>> <!-- ORACLE database driver --><dependency><groupId>com.oracle</groupId><artifactId>ojdbc6</artifactId><version>11.2.0</version></dependency> </dependencies></project>
Reference
- How to include library manually into Maven local repository
0 0
- How to add Oracle JDBC driver in your Maven local repository
- How To Add Oracle JDBC Driver In Your Maven Local Repository
- How to add Oracle JDBC driver in your Maven local repository
- Maven_How To Add Oracle JDBC Driver In Your Maven Local Repository
- How to add local jar into your local maven repository
- How To Add Intel Linux Graphics Driver Repository In Ubuntu
- How To Include Custom Library Into Maven Local Repository?
- How to make my own local repository in Ubuntu?
- Maven:the way to add third-party jar-package to Local Maven Repository for using conveniently
- how to use MongoDB Java driver in your env
- Add Microsoft SQL JDBC driver to Maven(转)
- How to add QuartzCore.framework for your project in xcode?
- How to Add Splash Screen in Your iOS App
- maven: install jar file in local repository
- How to add net.sf.json-lib dependendy in Maven
- How to Add Akka Configuration in Maven Project
- maven install jar file to local repository
- How to create a maven repository for your github project step by step
- 数据挖掘的一些课程
- Uploadify 控件上传图片 + 预览
- 获取一组radio的checked的value值
- 修复mac 下 make menuconfig 的bug以及自定义make menuconfig界面
- 從DTS到驅動加載的過程分析
- How To Add Oracle JDBC Driver In Your Maven Local Repository
- jQuery获取未选中的checkbox
- ViewPager + Fragment Fragment內跳轉
- png图片结构分析与加密解密原理
- nginx启用gzip压缩的示例
- Windows 64位安装Numpy和SciPy
- 再测一个mybatis调用oracle过程
- shell批量改dos format为unix
- 详解contextConfigLocation