22
May

executing maven profile from command line

Step 1: Define pom.xml with true profile and other profiles with activation properties

eg. Profile with default activation
————————————

INT

true



com.github.houbb
heaven
0.1.2

…….

maven profiles with activation properties:
——————————————-

STG
env
STG



com.applitools
eyes-common-java3
3.152.4

Example pom.xml:
——————–


4.0.0
com.maven.profiles
prfls
0.0.1-SNAPSHOT

INT

true



com.github.houbb
heaven
0.1.2

STG
env
STG



com.applitools
eyes-common-java3
3.152.4

Compiling from command prompt:
——————————

mvn -Denv=STG clean install ==> will execute STG profile

mvn clean install ==> will execute activeByDefault profile