Package org.apache.maven.enforcer.rules
Class ExternalRules
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExpressionEvaluator
private String
The external rules location.private static final String
private final org.apache.maven.plugin.MojoExecution
-
Constructor Summary
ConstructorsConstructorDescriptionExternalRules
(org.apache.maven.plugin.MojoExecution mojoExecution, ExpressionEvaluator evaluator) -
Method Summary
Modifier and TypeMethodDescriptionorg.codehaus.plexus.util.xml.Xpp3Dom
Produce rule configuration.private InputStream
void
setLocation
(String location) toString()
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
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
-
Field Details
-
LOCATION_PREFIX_CLASSPATH
- See Also:
-
location
The external rules location. If it starts with "classpath:", the resource is read from the classpath. Otherwise, it is handled as a filesystem path, either absolute, or relative to${project.basedir}
-
mojoExecution
private final org.apache.maven.plugin.MojoExecution mojoExecution -
evaluator
-
-
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
-
resolveDescriptor
- Throws:
EnforcerRuleError
-
toString
-