Intellij idea cannot resolve anything in maven

后端 未结 28 1898
一个人的身影
一个人的身影 2020-11-29 16:15

I\'m new to Intellij Idea, i just import a project with pom.xml, but the ide didn\'t resolve anything in maven dependencies.

Anything defined in p

相关标签:
28条回答
  • 2020-11-29 16:24

    I have encountered this problem,idea cannot download all dependent jar packages using maven,i just tried the following operations:

     mvn -U idea:idea
    

    then all the dependent jar packages are download from the maven repository

    0 讨论(0)
  • 2020-11-29 16:24

    I was also getting this error because the project imported main and test folders as modules. Click on Project --> Press F4 --> In Module settings, remove main and test folders and the make the project again. Problem will be resolved.

    0 讨论(0)
  • 2020-11-29 16:24
    1. Close IntelliJ
    2. Open the same project
    3. When the project loads, at the lower right you can see a pop up saying non-managed pom.xml file found, if you click on it a new pop up will come, saying add as maven project, click on it, and done.
    0 讨论(0)
  • 2020-11-29 16:25

    I ran into this issue when using IntelliJ 14's bundled Maven 3 instance.

    I switched to using my own local Maven instance, via:

    Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Maven Home Directory

    Then added the path to my locally installed instance.

    This got the dependencies to magically appear.

    0 讨论(0)
  • 2020-11-29 16:25

    It seems to me that solutions to this problem is plenty and all look a bit like magic. For me, invalidation of caches, re-importing or anything else already mentioned was not working. The only thing that helped was (without re-import) go to Maven settings, uncheck automatic importing and re-check it back.

    0 讨论(0)
  • 2020-11-29 16:31

    I was getting this error because my project was not setup correctly. It had imported main and test folders as modules. When I deleted the 2 modules (but retained them as source and test folders), my code started compiling correctly.

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