This is a snippet from my pom.xml. I tried the following, but the profile was not activated.
mvn clean install -Pdev1 mvn clean install -P dev1
Activation by system properties can be done as follows
foo bar
And run the mvn build with -D to set system property
mvn clean install -Dfoo=bar
This method also helps select profiles in transitive dependency of project artifacts.