maven-2mavenmaven-3

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. :)


Solution

  • 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.