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
All Implemented Interfaces:
EnforcerRule

public class RequireReleaseDeps
extends AbstractBanDependencies

This rule checks that no snapshots are included.

Version:
$Id: RequireReleaseDeps.java 989820 2010-08-26 16:52:46Z pgier $
Author:
Brian Fox

Field Summary
 List 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 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 checkDependencies(Set dependencies, org.apache.maven.plugin.logging.Log log)
          Checks the set of dependencies to see if any snapshots are included
 void execute(EnforcerRuleHelper helper)
          Override parent to allow optional ignore of this rule.
 Set filterArtifacts(Set 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.


failWhenParentIsSnapshot

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


excludes

public List 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 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.

Specified by:
execute in interface EnforcerRule
Overrides:
execute in class AbstractBanDependencies
Parameters:
helper - the helper
Throws:
EnforcerRuleException - the enforcer rule exception

checkDependencies

protected Set checkDependencies(Set dependencies,
                                org.apache.maven.plugin.logging.Log log)
                         throws EnforcerRuleException
Checks the set of dependencies to see if any snapshots are included

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 filterArtifacts(Set dependencies)

isOnlyWhenRelease

public boolean isOnlyWhenRelease()

setOnlyWhenRelease

public void setOnlyWhenRelease(boolean onlyWhenRelease)

isFailWhenParentIsSnapshot

public boolean isFailWhenParentIsSnapshot()

setFailWhenParentIsSnapshot

public void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.