Intellij idea cannot resolve anything in maven

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

    In Settings -> Maven -> Repositories only some repositories configured in my settings displayed.

    Workaround

    It is probably a bug (Idea 13.1.5 Ultimate). It helped me to switch the mirrors. The one that was not showing up to the top.

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

    go to External libraries and remove them all libraries that says root after click on reimport all project

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

    3 Simple Steps: IntelliJ 14:

    1. File>settings>Build,execution,deployment>Build tools

    2. Select Maven

    3. Maven home directory: C:/Program Files/apache-maven-3.3.3 (your equivalent location)

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

    I have tried several options, but this one finally solved my problem. I re-imported the project by following these steps in IntelliJ:

    1. File -> New -> Project From Existing Repositories
    2. Choose your project from 'Select File or Directory to Import'

    3. In the next screen choose 'Import Project From external model', and choose 'Maven.

    4. In the next step, click the checkbox 'Import Maven projects automatically', (that solved my problem)
    5. Finish up by choosing profiles if necessary

    For me re-importing maven projects did not solve the issue for an existing projects.

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

    If you have any dependencies in pom.xml specific to your organisation than you need to update path of setting.xml for your project which is by default set to your user directory in Ubuntu : /home/user/.m2/settings.xml -> (change it to your apache-maven conf path)

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

    Okay I was facing this problem for days. Was trying to import POI library and Simple JSON library, I tried all the proposed answers and solution nothing worked. In the end the solution for my case was quite simple

    I just needed to add the following to my module-info.java file after putting the dependencies in my POM file :

     requires poi.ooxml;
     requires poi;
     requires json.simple;
    

    so I think because my project was in a package in a module I had to do this to let the system knows that these imported libraries will be used. so simple put the library name after require in your module-info.java file

    Hope it works for you

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