Using Maven to just download JARs

2019-03-14 18:58发布

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

2条回答
放我归山
2楼-- · 2019-03-14 19:24

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.

查看更多
相关推荐>>
3楼-- · 2019-03-14 19:29

You can try this command:

mvn dependency:resolve

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

mvn install
查看更多
登录 后发表回答