I've come across this problem, when i was deleting maven modules in my project.
The case was that whenever when I reimported maven project, the Project File > Modules > Compiler Output Settings was set to
"Use module complite output path", but build would start only on "Inherit project compile output path"

I tried to google paths to put into there and I found out the paths should lead to target file generated by maven after mvn install - which was missing. After research I have understood that my master pom.xml doesnt have one key property.
<packaging>jar</packaging>
as such:
<project...>
<groupId>example.project</groupId>
<artifactId>example-project</artifactId>
<version>1.0.0</version>
<name>example-project</name>
<packaging>jar</packaging>
.
.
.
</project>
Then as shown on the picture I changed paths to target classes and test-classes and everything started to work.
Hope this helps!