问题
I have a multi-level Maven project that builds fine on the command-line using mvn clean install
and builds in IntelliJ IDEA (2019.3) by manually running the parent project's clean
and install
phase. The Problems view shows nothing wrong. When I open files that have certain external libraries, they show as being unable to be resolved:
I'm usually able to browse external libraries' contents in the project browser. I've noticed that these external libraries IntelliJ can't find are listed but not browsable.
Other people working on our project with the same code base and same IntelliJ version don't seem to have this problem. I've tried:
- "Reimport all Maven projects"
- File -> Invalidate Caches/Restart
- Completely deleting my
~/.m2/repository
- Completely deleting my
$PROJECT_ROOT/.idea
directory and reimporting - Recloning and reimporting the project from scratch
None of the above seem to work.
回答1:
The root case for this problem was not identified and is still under investigation, but what can help is removing the IDE settings and starting with the defaults.
来源:https://stackoverflow.com/questions/60569110/maven-project-builds-but-dependencies-seem-to-be-unavailable-in-intellij-idea