How to force maven update?

后端 未结 25 1913
失恋的感觉
失恋的感觉 2020-11-22 03:18

I imported my already working project on another computer and it started to download dependencies.

Apparently my internet connection crashed and now I get the foll

相关标签:
25条回答
  • For fixing this issue from Eclipse:

    1) Add below dependency in Maven pom.xml and save the pom.xml file.

    <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
    </dependency>
    

    2) Go to project >> Maven >> Update Project

    select the project and click OK.

    3) Optional step, if it's not resolved till step 2 then do below step after doing step-1

    Go to project >> Maven >> Update Project >> check in the checkbox 'Force Update of Snapshots/Releases'

    select the project and click OK.

    0 讨论(0)
  • 2020-11-22 03:48

    I had the same error and running mvn install -U and then running mvn install worked for me.

    0 讨论(0)
  • 2020-11-22 03:49

    If you're unsure what is inside your local repository, I recommend to fire a build with the option:

    -Dmaven.repo.local=localrepo
    

    That way you'll ensure to build in a cleanroom environment.

    0 讨论(0)
  • 2020-11-22 03:50

    If you are using eclipse IDE then :

    • Select Project.
    • Press alt+F5, window for Update Maven Project will pop up.

    • Check - Force Update of Snapshots/releases and click OK.

    If Using Intellij IDE

    • go to settings/Maven
    • check Always update snapshots
    0 讨论(0)
  • 2020-11-22 03:52

    I ran into this recently and running the following fixed all the problems

    mvn -fae install
    
    0 讨论(0)
  • 2020-11-22 03:57
    mvn clean install -U
    

    -U means force update of snapshot dependencies. Release dependencies can't be updated this way.

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