Skip to content

Maven Oracle JDBC Installation

To use the Oracle JDBC driver (specifically ojdbc7) within a Maven project, the JAR file must be installed into the local Maven repository manually because it is typically not available in public Maven repositories due to licensing restrictions^[600-developer-database-oracle-oracle-record.md].

Installation Command

The installation is performed using the mvn install:install-file command^[600-developer-database-oracle-oracle-record.md].

Syntax

mvn install:install-file -Dfile=[path-to-jar] -DgroupId=com.oracle -DartifactId=[artifact-id] -Dversion=[version] -Dpackaging=jar

Example

For instance, to install the ojdbc7-12.1.0.2.jar file located at C:/soft/git/git.pf2/pf2/lib/ojdbc7-12.1.0.2.jar, the following command is used^[600-developer-database-oracle-oracle-record.md]:

mvn install:install-file -Dfile=C:/soft/git/git.pf2/pf2/lib/ojdbc7-12.1.0.2.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.2 -Dpackaging=jar

Sources

^[600-developer-database-oracle-oracle-record.md]