Force re-download of release dependency using Maven

前端 未结 13 1807
闹比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:20

    When you added it to X, you should have incremented X's version number i.e X-1.2
    Then X-1.2 should have been installed/deployed and you should have changed your projects dependency on X to be dependent on the new version X-1.2

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

    I just deleted my ~/.m2/repository and that forced a re-download ;)

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

    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

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

    I think following command may help you!


    mvn -U clean install
    
    0 讨论(0)
  • 2020-11-28 20:30

    Most answers provided above would solve the problem.

    But if you use IntelliJ and want it to just fix it for you automatically, go to Maven Settings.

    Build,Execution, Deployment -> Build Tools -> Maven

    Disable Work Offline

    Enable Always update snapshots (Switch when required)

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

    If you know the group id of X, you can use this command to redownload all of X and it's dependencies

    mvn clean dependency:purge-local-repository -DresolutionFuzziness=org.id.of.x
    

    It does the same thing as the other answers that propose using dependency:purge-local-repository, but it only deletes and redownloads everything related to X.

    0 讨论(0)
提交回复
热议问题