How to update maven repository in Eclipse?
Solution 1:
You can right-click on your project then Maven > Update Project..., then select Force Update of Snapshots/Releases checkbox then click OK.
Solution 2:
In newer versions of Eclipse that use the M2E plugin it is:
Right-click on your project(s) --> Maven --> Update Project...
In the following dialog is a checkbox for forcing the update ("Force Update of Snapshots/Releases")
Solution 3:
Right-click on your project and choose Maven > Update Snapshots
. In addition to that you can set "update Maven projects on startup" in Window > Preferences > Maven
UPDATE: In latest versions of Eclipse:
Maven > Update Project
. Make sure "Force Update of Snapshots/Releases" is checked.
Solution 4:
Sometimes the dependencies don't update even with Maven->Update Project->Force Update option checked using m2eclipse plugin.
In case it doesn't work for anyone else, this method worked for me:
-
mvn eclipse:eclipse
This will update your .classpath file with the new dependencies while preserving your .project settings and other eclipse config files.
If you want to clear your old settings for whatever reason, you can run:
mvn eclipse:clean
-
mvn eclipse:eclipse
mvn eclipse:clean will erase your old settings, then mvn eclipse:eclipse will create new .project, .classpath and other eclipse config files.