Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: Command to update repository after adding dependency to POM

I've added a new dependency to my POM.

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

like image 278
DJ180 Avatar asked Dec 19 '11 16:12

DJ180


People also ask

What happens when we add dependency in pom xml?

If you have only the standard maven plugins from the default superpom, adding a dependency will: download the specified version to your local repository. use it to compile. use it to run tests.

How do I update my local Maven repository?

Click settings and search for "Repositories", then select the local repo and click "Update". That's all.


1 Answers

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

like image 117
Andrew Spencer Avatar answered Oct 01 '22 03:10

Andrew Spencer