Project '...-parent' not found; IntelliJ IDEA Maven parent POM false error & solution - Spring Boot

Опубликовано: 02 Октябрь 2024
на канале: cbttjm
14,343
88

add version ${project.parent.version} because IntelliJ IDEA doesn't parse the POM correctly
Projects with parent POMs sometimes falsely show as errors in IDEA, but build correctly from the command line with mvn.
The error in our case was "Project 'org:springframework.boot:spring-starter-parent:2.5.5' not found
The solution is NOT
- Invalidate caches and restart
- re-import the Maven project
Even though the dependency is in $HOME (%userprofile%) .m2, IDEA can't find it. But mvn command line can.
It is probably a good idea for IDEA to "Delegate IDE build/run actions to Maven" which we show here.
0:22 - mvn (command line) builds project
0:46 - coordinate IS in .m2
1:10 - Delegate IDE build/run actions to Maven
01:50 - solution version ${project.parent.version}