I have multiple questions.
Can I mix the goals of another project while executing mvn command on current
For the first question, see khmarbaise's answer
If you want to build more than one maven project in one step, you must use modules.
In a multi-module project, if you call mvn install
from the top project, all sub modules are built, unless you use the advanced reactor options (e.g. mvn install -pl util -am
only builds the module 'util' and it's dependencies)
Just mvn --help
would have answered the first question:
mvn -f otherPomFile.xml
No. You can simple execute the phases for the current project you are in. You can give multiple phases like
mvn clean install site site:deploy