This rule checks that a specified list of profiles is activated.
The following parameters are supported by this rule:
Sample Plugin Configuration:
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4.1</version> <executions> <execution> <id>enforce-all-profiles-are-activated</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireActiveProfile> <profiles>first,second</profiles> </requireActiveProfile> </rules> <fail>true</fail> </configuration> </execution> </executions> </plugin> </plugins> </build> [...] </project>
Sample Plugin Configuration to check if one of the given profiles is active:
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4.1</version> <executions> <execution> <id>enforce-first-or-second-profile-is-active</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireActiveProfile> <profiles>first,second</profiles> <all>false</all> </requireActiveProfile> </rules> <fail>true</fail> </configuration> </execution> </executions> </plugin> </plugins> </build> [...] </project>