Add Oracle JDBC Jar to Maven Repository

Update

These instructions are obsolete! Oracle JDBC Jars are published to the Maven central repo, no need to install manually.

If a jar is not available from a public repository (for example, Oracle JDBC jars), then you can get Maven to manually install a copy of the jar in the local repository. To manually deploy the Oracle JDBC driver to your local repository type the following:

1
2
3
4
5
6
mvn install:install-file \
 -Dfile=${ORACLE_HOME}/jdbc/lib/ojdbc6.jar \
 -Dpackaging=jar \
 -DgroupId=com.oracle \
 -DartifactId=ojdbc6 \
 -Dversion=11.1.0

where ${ORACLE_HOME} is the path to the Oracle Database installation. You can then reference the the jar via a dependency declaration like the following:

1
2
3
4
5
<dependency>
   <groupId>com.oracle</groupId>
   <artifactId>ojdbc6</artifactId>
   <version>11.1.0</version>
</dependency>
Ⓗ Home   Ⓑ Blog   Ⓐ About