How to simply download a JAR using Maven?

Maven does not work like that. Here’s the closest you’ll get to my knowledge:

mvn dependency:get -DremoteRepositories=http://repo1.maven.org/maven2/ \
                   -DgroupId=junit -DartifactId=junit -Dversion=4.8.2 \
                   -Dtransitive=false

Note that all parameters except transitive are required.
Also note that Maven will download the jar to your local repository, and there’s no sensible way (that I know of) to copy it to a local directory.

Reference:

Leave a Comment