This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes maven pom.xml: downloading dependancy from maven public repository Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven pom.xml: downloading dependancy from maven public repository" Watch "maven pom.xml: downloading dependancy from maven public repository" New topic
Author

maven pom.xml: downloading dependancy from maven public repository

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Hi,

I want to download the orai18n.jar that comes with oracle version 10.2 through maven pom.xml
I searched it on maven public repository but there is no entry for the version 10.2 . There are two entries for version 11.2.1 and version 14.

I tried below in pom.xml

<dependency>
<groupId>com.oracle</groupId>
<artifactId>orai18n</artifactId>
<version>10.2</version>
</dependency>

but it gives error. I need to have the exact version cause my code gives error with version 11.2 and 14 as I am using oracle 10.2.
How do I achieve this through maven pom.xml?

thanks
Trupti
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

If you can't find the version you need in a Mavne repository, you can always load it into your local repository. First, download the JAR you need from the Oracle web site, and then use the command that Maven gave you (it is part of the error message) to install the JAR locally.


JBoss In Action
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Thanks for the response.
But I am building the .war file and I want this jar to be there in the WEB_INF/lib directory everytime I build the war. can this be specified in pom.xml

I am new to maven and learing new things everyday!

Here is what I got the instructions on how to install it.

mvn install:install-file -DgroupId=com.oracle -DartifactId=orai18n -Dversi
on=10.2 -Dpackaging=jar -Dfile=/path/to/file

thanks
Trupti
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I want this jar to be there in the WEB_INF/lib directory everytime I build the war

Why do you want to do that? For runtime, I agree, but for compiling Maven always gets JAR files from the local repository (after downloading the JARs from one or more global repositories).

The dependency, as you have it, will cause the JAR file to be placed in WEB-INF/lib when Maven builds the WAR.

I assume that you have read Better Builds with Maven and Maven: The Definitive Guide, both free downloads.
 
 
subject: maven pom.xml: downloading dependancy from maven public repository
 
Similar Threads
Maven Error - Package does not exist, Symbols not recognised
jstl in eclipse with maven
Maven web project dependencies
Maven dependencies
Error slf4j-api, I can't exclude slf4j-api for Jboss