0

I would like to distribute my maven plugin in Sonatype's Open Source Software Repository Hosting (OSSRH).

My problem is, that the plugin uses Oracle's ojdbc6.jar. I know, that it is not allowed to distribute the driver alone, everybody is needed to download and install the plugin for himself.

What is the best practice, the common approach to publish a maven plugin with ojdbc - or other proprietary - dependency?

Should I just provide the

mvn install:install-file -DgroupId=com.oracle -DartifactId=oracle-jdbc -Dversion=11.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true

command in the documentation? (For example for that, see: https://github.com/jclagache/ojdbc-weave/blob/master/README.md#install-oracle-dependencies)

(Maybe I can use an open source jdbc driver for Oracle Database, if there is any, i'm just running selects [i did not find any])

1 Answers1

0

Your Oracle licence might allow you to distribute ojdbc with your maven plugin:

http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_12

Can third party vendors distribute Oracle's JDBC drivers along with their own software?

If you are a third party software company (and Oracle partner) then please check out Oracle's licensing terms spelled out at Oracle Licensing Agreement Please contact your local Oracle sales rep for more details.

Since there isn't any public Maven repository where you can reference ojdbc jar as a dependency, to bundle it in your plugin you can use the JAR in JAR method.

Otherwise if you really want your user to manually install the driver, would be nice to do a runtime check of the existence of oracle driver, and print a nice error with instruction how to install it if it doesn't exist. You can check using Class.forName() method (it will throw ClassNotFoundException if not found)

Community
  • 1
  • 1
gerrytan
  • 40,313
  • 9
  • 84
  • 99