Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Maven to just download JARs

I would like to have Maven download the JARs listed in a pom.xml file. How do I do that? Currently, Maven wants to compile the project (and it fails). I don't care about compiling it because I'm compiling manually. I just want the JARS. Help?

Albert

ps: Background, I am compiling it manually because I can easily debug the project in Eclipse. I've manually downloaded a bunch of JAR files, but I suspect there's a JAR version mismatch as there's a mysterious error at runtime. I would do this checking manually, but there are hundreds of associated JAR files. Ideally, I want to download all the JAR files, point my Eclipse project to the newly download JARS, and get on with my life. :)

like image 502
Albert Avatar asked Sep 26 '11 18:09

Albert


People also ask

Where are jars downloaded by Maven?

The Local Repository When we execute a Maven build, Maven automatically downloads all the dependency jars into the local repository.


2 Answers

You can try this command:

mvn dependency:resolve 

Or just invoke the "install" life cycle as follows:

mvn install 
like image 91
Mr.Eddart Avatar answered Sep 22 '22 00:09

Mr.Eddart


Your best approach is to use m2eclipse and import your pom into eclipse. It will download and link all dependencies to your project, and as an added bonus, it will also download and associate their source and javadoc jars. It does not really matter if the project has hundreds or just few dependencies, it will work the same.

Sometimes, we want to do something quickly and be done with it, but it ends up taking longer than doing the right away especially when there hundreds of dependencies.

like image 23
Pierre Avatar answered Sep 23 '22 00:09

Pierre