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 683054 2008-08-06 00:13:22Z brianf $
Author:
Brian Fox

Field Summary
 boolean failWhenParentIsSnapshot
          Allows this rule to fail when the parent is defined as a snapshot.
 boolean onlyWhenRelease
          Allows this rule to execute only when this project is a release.
 
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractBanDependencies
searchTransitive
 
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
message
 
Constructor Summary
RequireReleaseDeps()
           
 
Method Summary
protected  java.util.Set checkDependencies(java.util.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.
 boolean isFailWhenParentIsSnapshot()
           
 boolean isOnlyWhenRelease()
           
 void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)
           
 void setOnlyWhenRelease(boolean onlyWhenRelease)
           
 
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractBanDependencies
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.

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 java.util.Set checkDependencies(java.util.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

isOnlyWhenRelease

public boolean isOnlyWhenRelease()

setOnlyWhenRelease

public void setOnlyWhenRelease(boolean onlyWhenRelease)

isFailWhenParentIsSnapshot

public boolean isFailWhenParentIsSnapshot()

setFailWhenParentIsSnapshot

public void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)


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