My maven project structure is as below
Project A
pom.xml
- ProjectB
pom.xml
- ProjectC
pom.xml
- ProjectD
pom.xml
- ProjectY
p
Just in case someone else has this one too:
I also encountered this error message. The reason was that by accident I had been in one of my (sub-)modules in the path in terminal.
Of course the command has to be executed in the project's root hierarchy. According to the example above you have to assure that you execute a command like:
clean install -pl projectB
at Poject A
not e.g. at ProjectY or somewhere else deeper in the project structure.
Correct:
user:~/workspace/IdeaProjects/pojecta{master}$ clean install -pl projectB
Wrong:
user:~/workspace/IdeaProjects/pojecta/projecty{master}$ clean install -pl projectB