Package org.apache.maven.enforcer.rules
Class BannedRepositories
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.BannedRepositories
- All Implemented Interfaces:
EnforcerRuleBase
@Named("bannedRepositories")
public final class BannedRepositories
extends AbstractStandardEnforcerRule
This rule checks that this project's maven session whether have banned repositories.
- Author:
- Simon Wang
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
This is the interface into the rule.getLog()
Provide anEnforcerLogger
instance for Ruleprotected void
setAllowedPluginRepositories
(List<String> allowedPluginRepositories) protected void
setAllowedRepositories
(List<String> allowedRepositories) protected void
setBannedRepositories
(List<String> bannedRepositories) void
setLog
(EnforcerLogger log) Used byEnforcerMojo
to inject logger instancetoString()
Methods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessage
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
-
Constructor Details
-
BannedRepositories
-
-
Method Details
-
execute
Description copied from class:AbstractEnforcerRule
This is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.- Specified by:
execute
in classAbstractEnforcerRule
- Throws:
EnforcerRuleException
- the enforcer rule exception
-
setBannedRepositories
-
setAllowedRepositories
-
setAllowedPluginRepositories
-
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
-