Package org.apache.maven.enforcer.rules
Class BannedPlugins
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.BannedPlugins
- All Implemented Interfaces:
EnforcerRuleBase
This rule checks that lists of plugins are not included.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
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
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
excludes
Specify the banned plugins. This can be a list of plugins in the formatgroupId[:artifactId][:version]
. Any of the sections can be a wildcard by using '*' (ie group:*:1.0)
The rule will fail if any plugin matches any exclude, unless it also matches an include rule. -
includes
Specify the allowed plugins. This can be a list of plugins in the formatgroupId[:artifactId][:version]
. Any of the sections can be a wildcard by using '*' (ie group:*:1.0)
Includes override the exclude rules. It is meant to allow wide exclusion rules with wildcards and still allow a smaller set of includes.
For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api" -
session
private final org.apache.maven.execution.MavenSession session
-
-
Constructor Details
-
BannedPlugins
@Inject public BannedPlugins(org.apache.maven.execution.MavenSession session)
-
-
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
-
validate
private boolean validate(org.apache.maven.artifact.Artifact artifact) -
toString
-