Maven dependency update on commandline

164,088

Solution 1

mvn clean install -U

-U means force update of dependencies.

Also, if you want to import the project into eclipse, I first run:

mvn eclipse:eclipse

then run

mvn eclipse:clean

Seems to work for me, but that's just my pennies worth.

Solution 2

If you just want to re-load/update dependencies (I assume, with constantly changing you mean either SNAPSHOTS or local dependencies you update yourself), you can use

mvn dependency:resolve

Solution 3

Simple run your project online i.e mvn clean install . It fetches all the latest dependencies that you mention in your pom.xml and built the project

Solution 4

mvn clean install -U 

also make sure if you have your dependencies behind a VPN, you are connected to that VPN

Share:
164,088
cobie
Author by

cobie

A journey man searching for a reason Author of Intermediate Python available at https://leanpub.com/intermediatepython

Updated on July 08, 2022

Comments

  • cobie
    cobie almost 2 years

    I have a maven project that was built on the commandline for eclipse and one of the dependencies is constantly changing. How do I update this dependency on the commandline as I have heard that it is a bad idea to mix m2e plugin and commandline. Furthermore, I tried running mvn eclipse:eclipse on the command line and it messes up the project in eclipse removing the dependencies folder.