Force re-download of release dependency using Maven

前端 未结 13 1805
闹比i
闹比i 2020-11-28 20:05

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

相关标签:
13条回答
  • 2020-11-28 20:09

    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.

    0 讨论(0)
  • 2020-11-28 20:10

    Project right click-> Maven -> Update Project and check the checkboxes as in the screen shot. It will update releases as well :)

    enter image description here

    0 讨论(0)
  • 2020-11-28 20:14

    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.

    0 讨论(0)
  • 2020-11-28 20:18
    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.

    0 讨论(0)
  • 2020-11-28 20:18

    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

    0 讨论(0)
  • 2020-11-28 20:19

    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
    
    0 讨论(0)
提交回复
热议问题