I am currently trying to add profiles to a sub-module with maven. The purpose is to run a suite of cucumber tests but only in some circumstances (these are regression tests and we only want to run them when we build a release branch). I have written a profile in the pom of the module where the tests are. However, I cannot get the profile to activate. I’ve tried using the id of the profile in mvn clean test -Pcucumber
and also using a property with mvn clean test -Dcucumber
but it doesn’t work. Is there something I’m missing?
Snippet from the module pom showing the profile:
<profile>
<id>cucumber</id>
<activation>
<property>
<name>cucumber</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<includes>
<include>**/RunCucumber*.java</include>
</includes>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>