org.apache.maven.plugins.enforcer
Class RequireReleaseDeps

java.lang.Object
  extended by org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
      extended by org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
          extended by org.apache.maven.plugins.enforcer.AbstractBanDependencies
              extended by org.apache.maven.plugins.enforcer.RequireReleaseDeps

public class RequireReleaseDeps
extends AbstractBanDependencies

This rule checks that no snapshots are included.

Version:
$Id: RequireReleaseDeps.java 1345332 2012-06-01 20:14:13Z rfscholte $
Author:
Brian Fox

Field Summary
 List<String> excludes
          Dependencies to ignore when checking for release versions.
 boolean failWhenParentIsSnapshot
          Allows this rule to fail when the parent is defined as a snapshot.
 List<String> includes
          Dependencies to include when checking for release versions.
 boolean onlyWhenRelease
          Allows this rule to execute only when this project is a release.
 
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
message
 
Constructor Summary
RequireReleaseDeps()
           
 
Method Summary
protected  Set<Artifact> checkDependencies(Set<Artifact> dependencies, Log log)
          Checks the set of dependencies against the list of excludes.
 void execute(EnforcerRuleHelper helper)
          Override parent to allow optional ignore of this rule.
 Set<Artifact> filterArtifacts(Set<Artifact> dependencies)
           
 boolean isFailWhenParentIsSnapshot()
           
 boolean isOnlyWhenRelease()
           
 void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)
           
 void setOnlyWhenRelease(boolean onlyWhenRelease)
           
 
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractBanDependencies
getDependenciesToCheck, getErrorMessage, getMessage, isSearchTransitive, setMessage, setSearchTransitive
 
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
getCacheId, isCacheable, isResultValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onlyWhenRelease

public boolean onlyWhenRelease
Allows this rule to execute only when this project is a release.

Is defined by:

failWhenParentIsSnapshot

public boolean failWhenParentIsSnapshot
Allows this rule to fail when the parent is defined as a snapshot.

Is defined by:

excludes

public List<String> excludes
Dependencies to ignore when checking for release versions. For example, inter-module dependencies can be excluded from the check and therefore allowed to contain snapshot versions.


includes

public List<String> includes
Dependencies to include when checking for release versions. If any of the included dependencies have snapshot versions, the rule will fail.

Constructor Detail

RequireReleaseDeps

public RequireReleaseDeps()
Method Detail

execute

public void execute(EnforcerRuleHelper helper)
             throws EnforcerRuleException
Override parent to allow optional ignore of this rule.

Overrides:
execute in class AbstractBanDependencies
Parameters:
helper - the helper
Throws:
EnforcerRuleException - the enforcer rule exception

checkDependencies

protected Set<Artifact> checkDependencies(Set<Artifact> dependencies,
                                          Log log)
                                   throws EnforcerRuleException
Checks the set of dependencies against the list of excludes.

Specified by:
checkDependencies in class AbstractBanDependencies
Parameters:
dependencies - the dependencies
log - the log
Returns:
the sets the
Throws:
EnforcerRuleException - the enforcer rule exception

filterArtifacts

public Set<Artifact> filterArtifacts(Set<Artifact> dependencies)

isOnlyWhenRelease

public boolean isOnlyWhenRelease()

setOnlyWhenRelease

public void setOnlyWhenRelease(boolean onlyWhenRelease)

isFailWhenParentIsSnapshot

public boolean isFailWhenParentIsSnapshot()

setFailWhenParentIsSnapshot

public void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.