Intellij can't import Spring Boot project

Answered

I checked out a SpringBoot project.  It builds and runs from the command line with maven.  When I import it into IntelliJ as a maven project it complains that it can't find the SpringBoot classes.  One of the SpringBoot classes that it complains that it can't find is MediaType.  When I do Ctrl-N on MediaType it finds it in org.springframework:spring-web:5.0.10.RELEASE.

Why is the editor throwing errors when it can find the classes in the projects libraries?

 

0
3 comments

Looks like the problem is that there are 2 pom.xml files in this project.  I've never seen this use of maven before and it's apparently confusing IntelliJ.

0

Hi. Could you please provide a project example?

0

I can't upload the project because it's proprietary.  The problem was that the project had a pom.xml and domain-pom.xml (2 pom.xml files).  Someone decided to make a standalone library out of part of the maven project and instead of creating a new project they tried to do it in the same project.  I've never seen this in a maven project.  It must be an anti-pattern.  That is what caused the problem.

0

Please sign in to leave a comment.