I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14. In MVNrepository site the dependency to put in the POM is:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
of course this does't work as it is not in the central repository used by maven. 2 questions:
How do I find a repository (if any) that contains this artifact?
How do I add it so that Maven will use it?
You can use Nexus to manage 3rd party dependencies as well as dependencies in standard maven repositories.
Some Oracle Products support publishing maven artifacts to a local repository. The products have a plugin/maven directory which contains descriptions where to find those artifacts and where to store them. There is a Plugin from Oracle which will actually do the upload.
See: http://docs.oracle.com/middleware/1212/core/MAVEN/config_maven.htm
One of the products which may ship OJDBC in this way is the WLS, it uses however quite strange coordinates:
1. How do I find a repository (if any) that contains this artifact?
All Oracle Database JDBC Drivers are distribuited under the OTN License Agreement.
If you read the OTN License Agreement you find this license term:
so that's why you can't find the driver's jar in any public Maven Repository, because it would be distributed alone, and if it happened it would be a license violation.
Adding the dependency:
(or any later version) make Maven downloads the
ojdbc14-10.2.0.3.0.pom
only, and in that pom you can read:which informs you about the OTN License.
2. How do I add it so that Maven will use it?
In order to make the above dependency works I agree with victor hugo who were suggesting you here to manually install the jar into your local Maven repository (the
.m2
directory) by running:but I want to add that the license term above doesn't limit only where you can't find the JDBC jar, but it limits where you install it too!
In fact your local Maven repository must be private and not shared because if it was shared it would be a kind of distribution in which the jar is distributed alone, even if to a little group of people into your local area network, and this represent a OTN License Agreement violation.
Moreover I think you should avoid installing the JDBC jar in your corporation repository manager (such as Artifactory or Nexus) as a single artifact because if it was installed it would be still distributed alone, even if to people in your organization only, and this represents a OTN License Agreement violation.
SOLVED
This repository needs to be enable for finding Oracle 10.0.3.0 dependecies (this setting needs to be done in Buildconfig.groovy grails.project.dependency.resolver = "ivy" // or ivy
Also use following setting for compile time Oracle driver download
runtime "com.oracle:ojdbc:10.2.0.3.0"
This should solve your issue for not finding the Oracle driver for grails application
The Oracle JDBC Driver is now available in the Oracle Maven Repository (not in Central).
The Oracle Maven Repository requires a user registration. Instructions can be found in:
https://blogs.oracle.com/dev2dev/get-oracle-jdbc-drivers-and-ucp-from-oracle-maven-repository-without-ides
Oracle is now exposing a maven repository at maven.oracle.com However you need to be authenticated.
See https://blogs.oracle.com/WebLogicServer/entry/weblogic_server_and_the_oracle
According to the comments in the blog post the ojdbc driver should be available at the following coordinates: