Maven: Command to update repository after adding dependency to POM

JJ180 picture JJ180 · Dec 19, 2011 · Viewed 404.1k times · Source

I've added a new dependency to my POM.

Is there a simple command I can run to download this dependency to my repository?

Answer

Andrew Spencer picture Andrew Spencer · Dec 20, 2011

If you want to only download dependencies without doing anything else, then it's:

mvn dependency:resolve

Or to download a single dependency:

mvn dependency:get -Dartifact=groupId:artifactId:version

If you need to download from a specific repository, you can specify that with -DrepoUrl=...