I\'m working on a project with dependency X. X, in turn, depends on Y.
I used to explicitly include Y in my project\'s pom. However, it was not used and to make thin
Deleting the ~/.m2/repository
will solve your problem. But, if you still need to keep the old ~/.m2/repository
you can just change the maven local path temporarily.
If you are working on IntelliJ just go to Maven Settings and change the Local Repository path to somewhere else. You may need to tick the override checkbox near there.
Project right click-> Maven -> Update Project and check the checkboxes as in the screen shot. It will update releases as well :)
Just delete ~/.m2/repository...../actual_path where the invalid LOC is coming as it forces to re-download the deleted jar files. Dont delete the whole repository folder instead delete the specific folder from where the error is coming.
mvn clean install -U
-U means force update of dependencies.
If you want to update a single dependency without clean or -U you could just remove it from your local repo and then build.
Go to build path... delete existing maven library u added... click add library ... click maven managed dependencies... then click maven project settings... check resolve maven dependencies check box..it'll download all maven dependencies
If you really want to force-download all dependencies, you can try to re-initialise the entire maven repository. Like in this article already described, you could use:
mvn -Dmaven.repo.local=$HOME/.my/other/repository clean install