org.apache.maven.plugin.enforcer
Class BannedDependencies

java.lang.Object
  extended by org.apache.maven.plugin.enforcer.AbstractBanDependencies
      extended by org.apache.maven.plugin.enforcer.BannedDependencies
All Implemented Interfaces:
org.apache.maven.shared.enforcer.rule.api.EnforcerRule

public class BannedDependencies
extends AbstractBanDependencies

This rule checks that lists of dependencies are not included.

Version:
$Id$
Author:
Brian Fox

Field Summary
 java.util.ArrayList excludes
          Specify the banned dependencies.
 
Fields inherited from class org.apache.maven.plugin.enforcer.AbstractBanDependencies
message, searchTransitive
 
Constructor Summary
BannedDependencies()
           
 
Method Summary
protected  java.util.Set checkDependencies(java.util.Set theDependencies)
          Checks the set of dependencies against the list of excludes
protected  boolean compareDependency(java.lang.String[] exclude, org.apache.maven.artifact.Artifact artifact)
          Compares the parsed array of substrings against the artifact
 java.util.ArrayList getExcludes()
           
 void setExcludes(java.util.ArrayList theExcludes)
           
 
Methods inherited from class org.apache.maven.plugin.enforcer.AbstractBanDependencies
execute, getMessage, isSearchTransitive, setMessage, setSearchTransitive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

excludes

public java.util.ArrayList excludes
Specify the banned dependencies. This can be a list of artifacts in the format groupId[:artifactId][:version] Any of the sections can be a wildcard by using '*' (ie group:*:1.0)

Constructor Detail

BannedDependencies

public BannedDependencies()
Method Detail

checkDependencies

protected java.util.Set checkDependencies(java.util.Set theDependencies)
                                   throws org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException
Description copied from class: AbstractBanDependencies
Checks the set of dependencies against the list of excludes

Specified by:
checkDependencies in class AbstractBanDependencies
Returns:
Throws:
org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException

compareDependency

protected boolean compareDependency(java.lang.String[] exclude,
                                    org.apache.maven.artifact.Artifact artifact)
                             throws org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException
Compares the parsed array of substrings against the artifact

Parameters:
exclude -
artifact -
Returns:
Throws:
org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException

getExcludes

public java.util.ArrayList getExcludes()
Returns:
the excludes

setExcludes

public void setExcludes(java.util.ArrayList theExcludes)
Parameters:
theExcludes - the excludes to set


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.