IntellijIDEA not recognizing classes specified in Maven dependencies

后端 未结 24 1849
醉梦人生
醉梦人生 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:14

    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)
  • 2021-01-30 13:16

    You could go to:

    File > Settings > Build, Execution, Deployment > Build Tools > Maven

    and check if your pom.xml is not in the "Ignored Files" list.

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

    For reasons I don't understand, in my case, I needed turn on setting "Always update snapshots" in Build, Executions, Deployment > Build Tools > Maven.

    That made IntelliJ redownload dependencies and make it work.

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

    This also happened to me after upgrading Intellij to 1.4.15. I tried to re-import the whole project with same result, but enabling Maven Auto Import did the tricks.

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

    For some reason re-import did not do the trick. After looking at this:

    http://www.jetbrains.com/idea/webhelp/maven-importing.html

    I set auto-import and then the problem went away though; hopefully it helps someone else. Thanks for the ideas everyone :).

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

    I've encountered a similar issue after refactoring my maven project into different modules. Re-importing on it's own usually doesn't work, but I've found that deleting the .iml files and then re-importing usually does the trick.

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