You have to define different environment profiles in your pom.xml
<profiles>
<profile>
<activation>
<property>
<name>environment</name>
<value>test</value>
</property>
</activation>
...
</profile>
</profiles>
or give it a specific id/name like this
<profiles>
<profile>
<id>profile-1</id>
...
</profile>
</profiles>
and run mvn
using mvn groupId:artifactId:goal -Pprofile-1
You can find more information here