Due to Oracle licensing issues, MAVEN3 does not provide Oracle JDBC driver, in order to apply Oracle JDBC driver to the MAVEN project, it must be added to the local repository manually.
This document is for Oracle 11g.
first, to get Oracle JDBC Driver
1. Download the corresponding version through the official Oracle website: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
2. Obtained via ORACLE installation directory, located in "{Oracle_home}\jdbc\lib\ojdbc6.jar"
Add:
The Oracle installation directory has a db_1/jdbc/lib directory
Ojdbc5.jar Ojdbc5_g.jar Ojdbc5dms.jar
Ojdbc5dms_g.jar Ojdbc6.jar Ojdbc6_g.jar
Ojdbc6dms.jar Ojdbc6dms_g.jar
These few jar packs, so which driver version is 11G
This depends on your JDK, if your JDK is 1.5 with Ojdbc5.jar, if the JDK is 1.6 with Ojdbc6.jar.
Ojdbc5_g.jar, Ojdbc6dms_g.jar only compile with javac-g, generate all debugging information
Because the writer is a 1.7 jdk, it uses Ojdbc6.jar
Second Manual Installation
The order is as follows:
MVN install:install-file-dfile=D:\app\nyp\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar -dgroupid=com.oracle-dartifactid=ojdbc6-dversion=11.2.0-dpackaging=jar
D:\app\nyp\product\11.2.0\dbhome_1\jdbc\lib\ Ojdbc6.jar: This is the author's Ojdbc6.jar Absolute Path
to be in the same list of " |
D:\ideaprojects\springdemo>mvn install:install-file -dfile=d:\app\nyp\product\11.2.0\dbhome_1 \jdbc\lib\ojdbc6.jar -dgroupid=com.oracle -dartifactid=oj dbc6 -dversion=11.2.0 -dpackaging =jar [Info] scanning for projects ... downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/ Maven-surefire-plugin-2.4.3.pom downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/ maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom (7 kb at 1.3 kb/s |