Because of Oracle commercial copyright issues, MAVEN cannot download jar packages directly through the central repository, and if you want to use jar packs, you need to manually process them.
Step One: Place the Ojdbc14.jar in the user's directory, such as: C:\Users\qicyt1812
Step Two: Execute the command in cmd: mvn install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar
C:\USERS\QICYT1812>MVN install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar |
This installs the JDBC driver into Maven's local repository, which indicates that the installation was successful when the following code appeared in the cmd command.
C:\USERS\QICYT1812>MVN INSTALL:INSTALL-FILE-DGROUPID=COM.ORACLE-DARTIFACTID=OJDBC1 4-dversion=10.2.0.1.0-dpackaging=jar-dfile=ojdbc14.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-po M--- [INFO] Installing C:\Users\qicyt1812\ojdbc14.jar to D:\eclipse\apache-maven-local-re Pository\com\oracle\ojdbc14\10.2.0.1.0\ojdbc14-10.2.0.1.0.jar [INFO]------------------------------------------------------------------------ [INFO]Build SUCCESS [INFO]------------------------------------------------------------------------ [INFO] Total time:1.100s [INFO] Finished At:fri Oct 14:24:18 CST 2013 [INFO] Final memory:6m/53m [INFO]------------------------------------------------------------------------ |
Enter D:\eclipse\apache-maven-local-repository\com\oracle\ojdbc14\10.2.0.1.0\ view, successfully install to local
Step Three: Add dependency to the pom.xml of the required project
<!--load Oracel JDBC Driver package--> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.1.0</version> </dependency> |
With the above steps, Oracle driver can be used.