wood burning stoves*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to add existing jars using maven... 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 "How to add existing jars using maven..." Watch "How to add existing jars using maven..." New topic
Author

How to add existing jars using maven...

Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
Hi Friends,

I am new to maven. I am trying to change my existing project(using ant previously) to maven. I facing a problem adding my existing jars to the project. I have learnt from the internet that to do this, i have 2 options

1. Intalling the dependencies from the repository.
2. Add to the local repository (file by file) using
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

I dont want to install a huge number of files from the repository, so tried
second option but its really hard for me to install each jar file one by one. Is there any better option or something to automate this task ? Please help.

Thanks in advance,
P R A V E E N
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

I hope you're only trying to add your own jars, since Maven will automatically cache stuff as you use it - you don't have to manually install the public library jars.

What I'd do is make up a spreadsheet, one jar per row, with the columns containing the packaging info, export the spreadsheet to text and build a script that would take that text and substitute the data into maven commands, then execute those commands. Which is simpler than it sounds.

A real VBA geek might actually write an Excel macro to generate the maven commands out to a text file, but the end result is the same.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
jQuery in Action, 2nd edition
 
subject: How to add existing jars using maven...
 
Similar Threads
Compilation error using Maven 2.0.10
Change maven local repository in Sonatype plug for eclipse
Error Compiling Maven Project
problem with mvn deploy
Maven Local repository Vs nexus