org.apache.maven.plugins.enforcer
Class RequireActiveProfile

java.lang.Object
  extended by org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
      extended by org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
          extended by org.apache.maven.plugins.enforcer.RequireActiveProfile

public class RequireActiveProfile
extends AbstractNonCacheableEnforcerRule

This rule checks that some profiles are active.

Author:
Brian Fox

Field Summary
 boolean all
          If all profiles must be active.
 String profiles
          Comma separated list of profiles to check.
 
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
message
 
Constructor Summary
RequireActiveProfile()
           
 
Method Summary
 void execute(EnforcerRuleHelper theHelper)
           
protected  boolean isProfileActive(MavenProject project, String profileName)
          Checks if profile is active.
 
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
getCacheId, isCacheable, isResultValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profiles

public String profiles
Comma separated list of profiles to check.


all

public boolean all
If all profiles must be active. If false, only one must be active

Constructor Detail

RequireActiveProfile

public RequireActiveProfile()
Method Detail

execute

public void execute(EnforcerRuleHelper theHelper)
             throws EnforcerRuleException
Throws:
EnforcerRuleException

isProfileActive

protected boolean isProfileActive(MavenProject project,
                                  String profileName)
Checks if profile is active.

Parameters:
project - the project
profileName - the profile name
Returns:
true if profile is active, otherwise false


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.