aspose file tools*
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 Spring in Action this week in the Spring 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: 5836
    
    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: 5836
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven pom.xml: downloading dependancy from maven public repository