@Mojo(name="enforce",
defaultPhase=VALIDATE,
threadSafe=true)
public class EnforceMojo
extends AbstractEnforceMojo
| Modifier and Type | Field and Description |
|---|---|
protected static Hashtable<String,EnforcerRule> |
cache
This is a static variable used to persist the cached results across plugin invocations.
|
protected org.codehaus.plexus.PlexusContainer |
container |
protected boolean |
ignoreCache
Use this flag to disable rule result caching.
|
mojoExecution, project, session, skip, translator| Constructor and Description |
|---|
EnforceMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextualize(org.codehaus.plexus.context.Context context) |
protected String |
createRuleMessage(int i,
String currentRule,
EnforcerRuleException e)
Returns the error message displayed when failFast is set to false.
|
void |
execute()
Entry point to the mojo
|
EnforcerRule[] |
getRules() |
boolean |
isFail() |
boolean |
isFailFast() |
void |
setFail(boolean theFail) |
void |
setFailFast(boolean theFailFast) |
void |
setRules(EnforcerRule[] theRules) |
void |
setTranslator(org.apache.maven.project.path.PathTranslator theTranslator) |
protected boolean |
shouldExecute(EnforcerRule rule)
This method determines if a rule should execute based on the cache
|
getProject, getSession, getTranslator, isSkip, setProject, setSession, setSkip@Parameter(property="enforcer.ignoreCache",
defaultValue="false")
protected boolean ignoreCache
protected static Hashtable<String,EnforcerRule> cache
protected org.codehaus.plexus.PlexusContainer container
public void contextualize(org.codehaus.plexus.context.Context context)
throws org.codehaus.plexus.context.ContextException
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizablecontextualize in class AbstractEnforceMojoorg.codehaus.plexus.context.ContextExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException
execute in interface org.apache.maven.plugin.Mojoexecute in class AbstractEnforceMojoorg.apache.maven.plugin.MojoExecutionExceptionprotected boolean shouldExecute(EnforcerRule rule)
shouldExecute in class AbstractEnforceMojorule - the rule to verifytrue if rule should be executed, otherwise falsepublic boolean isFail()
isFail in class AbstractEnforceMojopublic void setFail(boolean theFail)
theFail - the fail to setpublic EnforcerRule[] getRules()
getRules in class AbstractEnforceMojopublic void setRules(EnforcerRule[] theRules)
setRules in class AbstractEnforceMojotheRules - the rules to setpublic void setFailFast(boolean theFailFast)
setFailFast in class AbstractEnforceMojotheFailFast - the failFast to setpublic boolean isFailFast()
isFailFast in class AbstractEnforceMojoprotected String createRuleMessage(int i, String currentRule, EnforcerRuleException e)
AbstractEnforceMojocreateRuleMessage in class AbstractEnforceMojoi - indexcurrentRule - name of the current rule.e - rule exceptionpublic void setTranslator(org.apache.maven.project.path.PathTranslator theTranslator)
setTranslator in class AbstractEnforceMojotheTranslator - the translator to setCopyright © 2007–2015 The Apache Software Foundation. All rights reserved.