Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle Drivers using Maven

 
Anirudh Vyas
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need oracle drivers for a maven project that i am working on. My question is how to install the drivers on the maven repository (local).
I am looking for complete command line thing for maven.I know that it goes something like:

mvn install:install-file -Dfile={Should i put complete path here?} -DgroupId=org.jdbc.OracleDriver <-- is this right?

I dont know what should come in artifact and version. Can someone give me the whole command line thing?

Any help would be appreciable.

Regards
Vyas, Anirudh
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, because you are placing the jar into your local repository, you can use any name and version you like. Personally, I would use a group id of "com.oracle.jdbc" and an artifact id of the actual jar file name without any version number or the jar suffix (I'd be more specific, but I don't use Oracle).

What I usually do is update my pom.xml file to include a dependency on JAR. Then I know how I want to reference the JAR. When I run mvn, it gives me the full command line for installing the jar.

And yes, you should provide the full path for the file property.
 
Anirudh Vyas
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!

I actually posted this question a while back on maven mailing list (but in my utter stupidity while i was cleaning my stored / archived mails) i deleted the command / chain which helped me solve the problem earlier.

Here's the actual command that would work for reference (It should presumably help others as well, i am going to post this on my site's maven basics section ) :

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14
-Dversion=10.0.2.0.0 -Dpackaging=jar -Dfile=path/to/file


After that you can run mvn clean install and it works! Oh and you have to manually copy jars to m2 repository folder m2/com/oracle/ <<YOUR VERSION>>/ <<JARS GO HERE>>

Regards
Vyas, Anirudh
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have to manually copy the JAR files? The mvn install command should be doing that for you.
 
Anirudh Vyas
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh it will? I didn't know that, I 'll give it a try.

Thanks!
 
Rhett Wang
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anirudh Vyas wrote:Hi,

I need oracle drivers for a maven project that i am working on. My question is how to install the drivers on the maven repository (local).
I am looking for complete command line thing for maven.I know that it goes something like:

mvn install:install-file -Dfile={Should i put complete path here?} -DgroupId=org.jdbc.OracleDriver <-- is this right?

I dont know what should come in artifact and version. Can someone give me the whole command line thing?

Any help would be appreciable.

Regards
Vyas, Anirudh



mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar

1 I would like use "CD" to make ojdbc.jar in the current folder, then I can just use -Dfile=ojdbc.jar
2 -DgroupId=com.oracle -DartifactId=ojdbc14

They just identify , you can use whatever you want. we'd better use com.oracle ;org.jdbc.OracleDriver or oracle for DgroupId
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rhett, why are you responding to this post? The post is almost 2 years old and the already contained the solution to the original poster's question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic