Oracle Driver Maven

 admin

This example is valid not only for Oracle driver, it is valid for any jar file which is not available in maven public repository. Java problems and solutions Unable to install Java 7 in Eclipse on Mac - Java 7 Mac OS issues. Oracle Database 12c Release 1 (12.1.0.1) drivers Oracle Datab ase 11 g Release 2 (11.2.0.4) drivers Get the Oracle JDBC drivers from the Oracle Maven Repository. 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: com.ora. This tutorial shows you how to add Oracle JDBC driver into Maven local repository and also how to reference it in pom.xml. Due to Oracle license restrictions, the Oracle JDBC driver is not available in the public Maven repository. Hi, I tried to get the Oracle JDBC driver 12.2.0.1 from the Oracle Maven repository by adding the following to my pom.xml. Follow this guide to install Oracle JDBC driver. Inserting example data in the database We are going to create following table and its corresponding sequence (Oracle does not provide feature like AUTO_INCREMENT embedded in the create table statement, we have to create a Sequence object separately and then use its reference in the insert statement).

  1. Oracle Driver Maven
  2. Oracle Thin Driver Maven
  3. Java Oracle Driver
Active2 months ago

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:

of course this does't work as it is not in the central repository used by maven.2 questions:

  1. How do I find a repository (if any) that contains this artifact?

  2. How do I add it so that Maven will use it?

MozenRath
4,98711 gold badges49 silver badges80 bronze badges
rperezrperez
3,96010 gold badges31 silver badges44 bronze badges

17 Answers

How do I find a repository (if any) that contains this artifact?

Unfortunately due the binary license there is no public repository with the Oracle Driver JAR. This happens with many dependencies but is not Maven's fault. If you happen to find a public repository containing the JAR you can be sure that is illegal.

How do I add it so that Maven will use it?

Some JARs that can't be added due to license reasons have a pom entry in the Maven Central repo. Just check it out, it contains the vendor's preferred Maven info:

..and the URL to download the file which in this case ishttp://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.

Once you've downloaded the JAR just add it to your computer repository with (note I pulled the groupId, artifactId and version from the POM):

The last parameter for generating a POM will save you from pom.xml warnings

If your team has a local Maven repository this guide might be helpful to upload the JAR there.

victor hugovictor hugo
30.5k12 gold badges61 silver badges75 bronze badges

For whatever reason, I could not get any of the above solutions to work. (Still can't.)

What I did instead was to include the jar in my project (blech) and then create a 'system' dependency for it that indicates the path to the jar. It's probably not the RIGHT way to do it, but it does work. And it eliminates the need for the other developers on the team (or the guy setting up the build server) to put the jar in their local repositories.

UPDATE: This solution works for me when I run Hibernate Tools. It does NOT appear to work for building the WAR file, however. It doesn't include the ojdbc6.jar file in the target WAR file.

1) Create a directory called 'lib' in the root of your project.

2) Copy the ojdbc6.jar file there (whatever the jar is called.)

3) Create a dependency that looks something like this:

Ugly, but works for me.

To include the files in the war file add the following to your pom

ROMANIA_engineer
37.3k20 gold badges164 silver badges154 bronze badges
MarvoMarvo
14k6 gold badges42 silver badges65 bronze badges
12c

Download the jar and place it in your project src/lib. Now you can use the maven installer plugin.

Now you only have to execute mvn clean once and the oracle lib is installed in your local maven repository.

Stephan
28.9k32 gold badges165 silver badges265 bronze badges
Peter EnisPeter Enis

Oracle is now exposing a maven repository at maven.oracle.comHowever 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:

SebastienSebastien
ROMANIA_engineer
37.3k20 gold badges164 silver badges154 bronze badges
searching9xsearching9x

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:

Bienvenido DavidBienvenido David
2,4581 gold badge16 silver badges12 bronze badges

1. How do I find a repository (if any) that contains this artifact?

As DavidS has commented the line I quoted at the time I answered is no longer present in the current (at the time I'm writing now) OTN License Agreement agreement I linked. Consider this answer only for older version of the artifact, as the 10.2.0.3.0 and the like.

All Oracle Database JDBC Drivers are distribuited under the OTN License Agreement.

If you read the OTN License Agreement you find this license term:

You may not:
..
- distribute the programs unless accompanied with your applications;
..

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?

Revo uninstaller pro keygen. 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.

taringamberinitaringamberini

You can use Nexus to manage 3rd party dependencies as well as dependencies in standard maven repositories.

Michael MunseyMichael Munsey
2,7571 gold badge19 silver badges14 bronze badges

Up to now, its not possible to use maven repositories. I'm using ivy as dependency management tool, but also use maven2' s ibiblio repositories. And this is working for ivy:

Maven2' s dependency could be something like that:

Notice that i define http://download.java.net/maven/2/ and http://mirrors.ibiblio.org/pub/mirrors/maven/mule/dependencies/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext] as external maven2 repos on my ivy settings.

Betlista
7,1968 gold badges52 silver badges87 bronze badges
tugcemtugcem
7552 gold badges10 silver badges23 bronze badges

Good news everyone! Finally we can use Oracle's official repo:https://blogs.oracle.com/dev2dev/get-oracle-jdbc-drivers-and-ucp-from-oracle-maven-repository-without-ides

Vladimir ChervanevVladimir Chervanev
9611 gold badge9 silver badges13 bronze badges

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:

eckeseckes
8,2331 gold badge41 silver badges61 bronze badges

I ship opensource under LGPLv2 and even after several email conversations with Oracle they were unclear whether I was allowed to ship their binary JDBC driver with my distribution. The issue related to whether my license was compatible with their OTN terms so they suggested I was not permitted to ship the driver. Presumably related to this part

(b) to distribute the programs with applications you have developed to your customers provided that each such licensee agrees to license terms consistent with the terms of this Agreement

So even if you manage to publish the driver legally in your exclusive/local maven repository there is still the restriction on what you are permitted to do with that artifact. Seems absurd that even if I ship their driver in binary form along with the full OTN license file I still can't use it and must force my users to manually download the Oracle driver and drop into my library path before they can use my software.

CraigCraig

There is one repo that provides the jar. In SBT add a resolver similar to this:'oracle driver repo' at 'http://dist.codehaus.org/mule/dependencies/maven2'

and a dependency:'oracle' % 'ojdbc14' % '10.2.0.2'

You can do the same with maven. pom.xml and jar are available (http://dist.codehaus.org/mule/dependencies/maven2/oracle/ojdbc14/10.2.0.2/).

yǝsʞǝlayǝsʞǝla
14k1 gold badge35 silver badges55 bronze badges

If you are using Netbeans, goto Dependencies and manually install artifact. Locate your downloaded .jar file and its done. clean build will solve any issues.

Zafrullah SyedZafrullah Syed
6262 gold badges8 silver badges32 bronze badges

You can find a Github simple sample project for use a Oracle JDBC Driver on Maven Project here.

You can find all explication for your continous integration + a sample and run on Travis-CI.

sgrillonsgrillon
4,6363 gold badges36 silver badges67 bronze badges
bosco1bosco1

SOLVED

  • Please do following settings to resolve the error

This repository needs to be enable for finding Oracle 10.0.3.0 dependecies (this setting needs to be done in Buildconfig.groovygrails.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

MakarandMakarand

Oracle Driver Maven

protected by Samuel LiewJan 23 '16 at 9:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Oracle Thin Driver Maven

Not the answer you're looking for? Browse other questions tagged javamavenjdbcmaven-2mvn-repo or ask your own question.

Java Oracle Driver

Download

Release Notes

(2,739,670 bytes) - (SHA1 Checksum: a483a046eee2f404d864a6ff5b09dc0e1be3fe6c)

Certified with JDK8, JDK7, and JDK6;

(2,091,137 bytes) - (SHA1 Checksum: 5543067223760fc2277fe3f603d8c4630927679c)

For use with JDK1.5;

(506,301 bytes) - (SHA1 Checksum: 5520b4e492939b477cc9ced90c03bc72710dcaf3)
(10,591 bytes) - Sample security policy file for Oracle Database JDBC drivers
(1,655,734 bytes) - (SHA1 Checksum: 02ca732c9b5043d39a6b300d190ba0dbce29f3a3)

NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files

(263,097 bytes) - (SHA1 Checksum: 7604939a619d2f8bd2a02480ab785c2b4a02e3a7)

Classes to support standard JDBC 4.x java.sql.SQLXML interface (Java SE 6 & Java SE 7).

(71,830 bytes) - (SHA1 Checksum: 3516a84f4e26caab41d560678bb59076666543f7)

For use by the pure Java client-side Oracle Notification Services (ONS) daemon

(20,365 bytes) - (SHA1 Checksum: 307a7e203d7e141964158d181ca849d512d7e710)

Java APIs for subscribing to RAC events via ONS; simplefan policy and javadoc