How to load an Oracle driver in a MAVEN project

Source: Internet
Author: User

Because of Oracle's commercial copyright issues, maven cannot download the jar package directly from the central repository, and if you want to use a jar package, you need to handle it manually.

The first step: Put Ojdbc14.jar in the user directory, for example: 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=OJDBC1 4-dversion=10.2.0.1.0-dpackaging=jar-dfile=ojdbc14.jar
This installs the JDBC driver into the MAVEN local repository, and when the following code appears in the CMD command, the installation is successful.
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 these steps, you can use the Oracle driver.

Reprinted from: http://blog.csdn.net/qicyt1812/article/details/13019933

How to load an Oracle driver in a MAVEN project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.