I have two profiles for different environments in pom.xml, I have to run mvn -PTest1 install and mvn -PTest2 install command to get th
pom.xml
mvn -PTest1 install
mvn -PTest2 install
Mifeet's answer is correct, but in Windows PowerShell you should quote parameters, otherwise you'll get "unknown lifecycle phase" error.
mvn install -P 'Test1,Test2'