Intellij idea cannot resolve anything in maven

后端 未结 28 1896
一个人的身影
一个人的身影 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:42

    I had empty settings.xml file in Users/.../.m2/settings.xml. When i added

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
    
    </settings>
    

    all dependicies were loaded

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

    I had the very same problem as author!

    To solve my issue I had to add Maven Integration Plugin: File | Settings | Plugins

    Like this:

    Maven Integration Plugin

    After that Intellij downloaded all the dependencies from pom.xml file.

    Now if I want to create a project based on maven model, I just choose Open on the first Intellij window and choose the pom.xml file:

    enter image description here

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

    If you imported your maven project in IntelliJ and there are errors because of maven imports not getting resolved, it maybe because of the custom maven settings.xml you may be using. I tried overriding it in the Intellij default maven settings but it did not help. Finally I had to keep it in ~/.m2/settings.xml and then IntelliJ finally honored it.

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

    With intelliJ 16.1.4 I had the same issue. You should have a look at the Event Log, because it told me "Non-managed pom.xml file found:..." I then clicked on it and the problem was solved.

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