Intellij idea cannot resolve anything in maven

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

    try maven command shared below it would work!

    mvn idea:idea
    
    0 讨论(0)
  • 2020-11-29 16:37

    Unfortunately I ran into the same issue and I was head scratching why this is happening. I almost tried everything on this page and but none worked for me.

    So , I tried to go the root of this problem; and the problem was (Atleast for me) that I was trying to open a maven project but pom file was not identified. So right clicking on the pom file and choosing "add as maven project" and then right clicking on the project -> Maven -> Reimport did all the magic for me :)

    Hopefully this can be helpful for someone.

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

    In IntelliJ 12.1.4 I went through Settings --> Maven --> Importing and made sure the following was selected:

    1. Import Maven projects automatically
    2. Create IDEA modules for aggregator projects
    3. Keep source...
    4. Exclude build dir...
    5. Use Maven output...
    6. Generated souces folders: "detect automatically"
    7. Phase to be...: "process-resources"
    8. Automatically download: "sources" & "documentation"
    9. Use Maven3 to import project
      • VM options for importer: -Xmx512m

    This took me from having a lot of unresolved import statements to having everything resolved. I think the key here was using Maven3 to import project... Hopefully this helps.

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

    I have just had this issue when adding <dependency>...</dependency> elements to a <profile>. I just found that if I add (insert) the unresolved dependency elements to the <dependencies> element, the dependencies are downloaded from the maven repository; I can then remove the dependency element from the dependencies element.

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

    To me the problem what that I had to check the box "Import maven projects automatically" under Setting> Maven>Importing

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

    Using default maven (which comes with IntelliJ) also could create this problem. So configure the maven which you have installed.

    This can be done from: File -> Settings -> Build, Execution, Deployment -> Maven

    Update following settings according to your maven installation:

    1. Maven home directory =
    2. User settings file =
    3. Local repository =
    0 讨论(0)
提交回复
热议问题