public class RequireReleaseDeps extends AbstractBanDependencies
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
excludes
Dependencies to ignore when checking for release versions.
|
private boolean |
failWhenParentIsSnapshot
Allows this rule to fail when the parent is defined as a snapshot.
|
private java.util.List<java.lang.String> |
includes
Dependencies to include when checking for release versions.
|
private boolean |
onlyWhenRelease
Allows this rule to execute only when this project is a release.
|
Constructor and Description |
---|
RequireReleaseDeps() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<org.apache.maven.artifact.Artifact> |
checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies,
org.apache.maven.plugin.logging.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.
|
java.util.Set<org.apache.maven.artifact.Artifact> |
filterArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> dependencies) |
java.util.List<java.lang.String> |
getExcludes() |
java.util.List<java.lang.String> |
getIncludes() |
private org.apache.maven.project.MavenProject |
getProject(EnforcerRuleHelper helper) |
boolean |
isFailWhenParentIsSnapshot() |
boolean |
isOnlyWhenRelease() |
void |
setExcludes(java.util.List<java.lang.String> excludes) |
void |
setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot) |
void |
setIncludes(java.util.List<java.lang.String> includes) |
void |
setOnlyWhenRelease(boolean onlyWhenRelease) |
getDependenciesToCheck, getErrorMessage, isSearchTransitive, setSearchTransitive
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
private boolean onlyWhenRelease
#setOnlyWhenRelease(boolean)}
,
#isOnlyWhenRelease()}
private boolean failWhenParentIsSnapshot
#setFailWhenParentIsSnapshot(boolean)}
,
#isFailWhenParentIsSnapshot()}
private java.util.List<java.lang.String> excludes
#setExcludes(List)}
,
#getExcludes()}
private java.util.List<java.lang.String> includes
#setIncludes(List)}
,
#getIncludes()}
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
execute
in interface EnforcerRule
execute
in class AbstractBanDependencies
helper
- the enforcerRuleHelperEnforcerRuleException
- when an exception occursprivate org.apache.maven.project.MavenProject getProject(EnforcerRuleHelper helper) throws EnforcerRuleException
helper
- MavenProject
.EnforcerRuleException
protected java.util.Set<org.apache.maven.artifact.Artifact> checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies, org.apache.maven.plugin.logging.Log log) throws EnforcerRuleException
checkDependencies
in class AbstractBanDependencies
dependencies
- the dependencieslog
- the logEnforcerRuleException
- the enforcer rule exceptionpublic java.util.Set<org.apache.maven.artifact.Artifact> filterArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> dependencies)
public final boolean isOnlyWhenRelease()
public final void setOnlyWhenRelease(boolean onlyWhenRelease)
public final boolean isFailWhenParentIsSnapshot()
public final void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot)
public final void setExcludes(java.util.List<java.lang.String> excludes)
public final java.util.List<java.lang.String> getExcludes()
public void setIncludes(java.util.List<java.lang.String> includes)
public java.util.List<java.lang.String> getIncludes()