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 ExpressionEvaluatorprivate StringThe external rules location.private static final Stringprivate 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.Xpp3DomProduce rule configuration.private InputStreamvoidsetLocation(String location) toString()Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLogMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:AbstractEnforcerRuleConfigProviderProduce rule configuration.Returned configuration must contain rules configuration as in example:
<rules> <ruleName/> <ruleName> <ruleConfig>config value</ruleConfig> </ruleName> </rules>- Specified by:
getRulesConfigin classAbstractEnforcerRuleConfigProvider- Returns:
- a rules configuration
- Throws:
EnforcerRuleError- the error during executing
-
resolveDescriptor
- Throws:
EnforcerRuleError
-
toString
-