Intellij Idea taking forever to resolve maven dependencies

后端 未结 2 871
渐次进展
渐次进展 2021-02-18 21:53

I am using intellij idea ultimate version 12.1.4 and trying to use maven with a project. Here is my pom.xml:


<         


        
相关标签:
2条回答
  • 2021-02-18 22:10

    If this is an issue very specific to intellij, I would suggest do the following steps You can try running mvn clean install.(Depending on your network speed it will pull every dependency)

    Change intellij settings in Preferences->build,execution,deployment->maven->Maven home directory->{now change this to point to your mvn home rather than bundled mvn}

    mvn -v in command line should give you the maven home path. Now it won't try to download dependencies again.

    0 讨论(0)
  • 2021-02-18 22:10

    File | Settings | Build, Execution, Deployment | Build Tools | Maven | Threads (-T option) | 16 (or however many threads you want to try)

    mvn compile -T 8
    

    I had the same issue. Maven was taking an hour in IntelliJ and also running from the command line. Using the -T parameter you can tell Maven to use more threads to download artifacts simultaneously. Takes only about 15 minutes now.

    Don't use bundled mvn. Point "Maven home directory" to the path on your file system.

    After you're done building. Check "Work offline". This stops mvn from searching remote websites each time you build. Uncheck when you update your POM file so it can search for the changes.

    You can also skip tests. This is evertyhing from the command line.

    mvn clean install -T 50 -o -DskipTests 
    
    0 讨论(0)
提交回复
热议问题