views:

67

answers:

3

Hi, I would like something like the following.

I want just an utility that is able to download jars and their dependencies from the Maven Repository without imposing no constraints on how my project should be built.

I would like something like this:

download-jar --dest=lib/ 'commons-io:commons-io:jar:1.4'

It should be able to download also the dependencies.

Update:

I wouldn't know about a pom.xml should be structured.

The only task I need to be accomplished is the download of the jars, I would like have a tool that could accomplish this task that doesn't bother me with superflous information.

There is something like that?

A: 

You should take a look at the maven dependency plugin, maybe ... and especially its go-offline mojo

Riduidel
+5  A: 
Colin Hebert
Thank you. This requires to have a proper pom.xml. This is the think I would avoid. Do you know a way to obtain the same result without defining the pom?
Andrea Francia
Making a proper maven pom.xml and using that to download your dependencies takes about a 5 minutes. Setting up some other software and configuring it to scrape the library and parse POM.xmls for your dependencies and download those dependencies recursively will take quite a bit longer.
Chris Nava
@Chris No need to setup a POM, no need to develop your own tool, use `mvn dependency:get`.
Pascal Thivent
@Pascal Thivent, Nice one, `dependency:get` doesn't appear on the dependency's goals list.
Colin Hebert
@Colin You need version 2.1 of the dependency plugin. Follow [the link](http://stackoverflow.com/questions/1776496/a-simple-command-line-to-download-a-remote-maven2-artifact-to-the-local-repositor) of my comment to the question.
Pascal Thivent
@Pascal Even quicker. I learn something new here every day.
Chris Nava
A: 

Have a look at Ivy. It allows dependency resolution from maven repositories without the overkill complexity of maven itself.

Maxim Veksler