IntellijIDEA not recognizing classes specified in Maven dependencies

后端 未结 24 1851
醉梦人生
醉梦人生 2021-01-30 12:57

I have a project in IntellijIDEA which was created with Maven. I then specified a set of dependencies and external repositories in the Pom.xml file.

The project builds

相关标签:
24条回答
  • 2021-01-30 13:03

    For me the problem seems to be a conflict with the maven helper plugin (https://plugins.jetbrains.com/plugin/7179?pr=idea).

    I disable it, and it works again :)

    0 讨论(0)
  • 2021-01-30 13:05

    For me File>>Invalidate Cache/Restart>>Invalidate and Restart worked in IntelliJ

    0 讨论(0)
  • 2021-01-30 13:06

    For my case I should have checked the work offline

    Go to File>Settings >Build, Execution, Deployment >Build tools>Maven Then check Work Offline

    0 讨论(0)
  • 2021-01-30 13:07

    The problem was caused for me by selecting the project directory to be Imported when first starting IntelliJ rather than the pom.xml file for the project.

    Closing the problem project and then following the Import process again but choosing the pom.xml resulted in a fully working project in the IDE.

    0 讨论(0)
  • 2021-01-30 13:08

    Just delete your project's .idea folder and re-import your project in IntelliJ.

    0 讨论(0)
  • 2021-01-30 13:14

    I was running into similar issues. For me it ended up being that I was importing the project incorrectly. I had been doing

    import project
        <navigate to existing project and click top level directory>
        follow the wizard
    

    What solved my maven problems was to do

    import project
        <navigate to existing project and click the pom.xml
        follow the wizard
    
    0 讨论(0)
提交回复
热议问题