Force maven to fetch dependencies from the remote repository while building the project. We can use -U/--update-snapshots flag when building a maven project to force maven to download dependencies from the remote repository.
You can right-click on your project then Maven > Update Project..., then select Force Update of Snapshots/Releases checkbox then click OK.
Press Ctrl + Shift + A to find actions, and input "reload", you will find the "Reload All Maven Projects". On a Mac, use ⌘ + ⇧ + A instead.
You cannot make Maven re-download dependencies, but what you can do instead is to purge dependencies that were incorrectly downloaded using mvn dependency:purge-local-repository
See: http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html
This looks up the list of all transitive dependencies of the current project, deletes them, then redownloads them. You can even add it as a plugin into your pom if you want to run it with every build.
I just deleted my ~/.m2/repository and that forced a re-download ;)
Based on Ali Tokmen answer. I managed to force delete a single specific local dependency with the following command:
mvn dependency:purge-local-repository -DmanualInclude=com.skyfish:utils
With this, it removes utils
from my .m2/repository and it always re-download the utils
JAR dependency when I proceed to run mvn clean install
. If you want something more programmatic possibly also see the -Dinclude=...
option.
I think following command may help you!
mvn -U clean install
Project right click-> Maven -> Update Project and check the checkboxes as in the screen shot. It will update releases as well :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With