Class BannedPlugins

    • Field Detail

      • excludes

        private java.util.List<java.lang.String> excludes
        Specify the banned plugins. This can be a list of plugins in the format groupId[: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

        private java.util.List<java.lang.String> includes
        Specify the allowed plugins. This can be a list of plugins in the format groupId[: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 Detail

      • BannedPlugins

        @Inject
        public BannedPlugins​(org.apache.maven.execution.MavenSession session)
    • Method Detail

      • execute

        public void execute()
                     throws EnforcerRuleException
        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 class AbstractEnforcerRule
        Throws:
        EnforcerRuleException - the enforcer rule exception
        EnforcerRuleError - in order to brake a build immediately
      • validate

        private boolean validate​(org.apache.maven.artifact.Artifact artifact)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object