Package org.apache.maven.enforcer.rules
Class ExternalRules
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleConfigProvider
org.apache.maven.enforcer.rules.ExternalRules
- All Implemented Interfaces:
EnforcerRuleBase
An enforcer rule that will provide rules configuration from an external resource.
- Since:
- 3.2.0
- Author:
- George Gastaldi
-
Constructor Summary
ConstructorDescriptionExternalRules
(org.apache.maven.plugin.MojoExecution mojoExecution, ExpressionEvaluator evaluator) -
Method Summary
Modifier and TypeMethodDescriptiongetLog()
Provide anEnforcerLogger
instance for Ruleorg.codehaus.plexus.util.xml.Xpp3Dom
Produce rule configuration.void
setLocation
(String location) void
setLog
(EnforcerLogger log) Used byEnforcerMojo
to inject logger instancetoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.maven.enforcer.rule.api.EnforcerRuleBase
getLevel
-
Constructor Details
-
ExternalRules
@Inject public ExternalRules(org.apache.maven.plugin.MojoExecution mojoExecution, ExpressionEvaluator evaluator)
-
-
Method Details
-
setLocation
-
getRulesConfig
Description copied from class:AbstractEnforcerRuleConfigProvider
Produce rule configuration.Returned configuration must contain rules configuration as in example:
<rules> <ruleName/> <ruleName> <ruleConfig>config value</ruleConfig> </ruleName> </rules>
- Specified by:
getRulesConfig
in classAbstractEnforcerRuleConfigProvider
- Returns:
- a rules configuration
- Throws:
EnforcerRuleError
- the error during executing
-
toString
-
setLog
Used byEnforcerMojo
to inject logger instance- Specified by:
setLog
in interfaceEnforcerRuleBase
- Parameters:
log
- anEnforcerLogger
instance
-
getLog
Provide anEnforcerLogger
instance for RuleNOTICE A logger is not available in constructors.
- Returns:
- an
EnforcerLogger
instance
-