public class RequirePluginVersions extends AbstractNonCacheableEnforcerRule
| Modifier and Type | Field and Description |
|---|---|
List<String> |
additionalPlugins
Deprecated.
the visibility will be reduced to private with the next major version
|
boolean |
banLatest
Deprecated.
the visibility will be reduced to private with the next major version
|
boolean |
banRelease
Deprecated.
the visibility will be reduced to private with the next major version
|
boolean |
banSnapshots
Deprecated.
the visibility will be reduced to private with the next major version
|
boolean |
banTimestamps
Deprecated.
the visibility will be reduced to private with the next major version
|
String |
phases
Deprecated.
the visibility will be reduced to private with the next major version
|
String |
unCheckedPluginList
Deprecated.
the visibility will be reduced to private with the next major version
|
List |
unCheckedPlugins
Deprecated.
the visibility will be reduced to private with the next major version
|
message| Constructor and Description |
|---|
RequirePluginVersions() |
| Modifier and Type | Method and Description |
|---|---|
Set<org.apache.maven.model.Plugin> |
addAdditionalPlugins(Set<org.apache.maven.model.Plugin> existing,
List<String> additional)
Add the additional plugins if they don't exist yet.
|
Collection<String> |
combineUncheckedPlugins(Collection<String> uncheckedPlugins,
String uncheckedPluginsList)
Combines the old Collection with the new comma separated list.
|
void |
execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper) |
protected org.apache.maven.model.Plugin |
findCurrentPlugin(org.apache.maven.model.Plugin plugin,
org.apache.maven.project.MavenProject project)
Given a plugin, this will retrieve the matching plugin artifact from the model.
|
List<String> |
getAdditionalPlugins() |
protected List<PluginWrapper> |
getAllPluginEntries(org.apache.maven.project.MavenProject project)
Gets all plugin entries in build.plugins, build.pluginManagement.plugins, profile.build.plugins, reporting and
profile.reporting in this project and all parents
|
protected Set<org.apache.maven.model.Plugin> |
getBoundPlugins(org.apache.maven.lifecycle.LifecycleExecutor life,
org.apache.maven.project.MavenProject project,
String thePhases)
Gets the plugins that are bound to the defined phases.
|
String |
getPhases() |
Map<String,org.apache.maven.lifecycle.Lifecycle> |
getPhaseToLifecycleMap()
Gets the phase to lifecycle map.
|
Set<org.apache.maven.model.Plugin> |
getProfilePlugins(org.apache.maven.project.MavenProject project)
Finds the plugins that are listed in active profiles.
|
List |
getUnCheckedPlugins() |
protected EnforcerRuleUtils |
getUtils()
Gets the utils.
|
protected boolean |
hasValidVersionSpecified(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
List<PluginWrapper> pluginWrappers)
Checks for valid version specified.
|
protected boolean |
isBanLatest()
Checks if is ban latest.
|
protected boolean |
isBanRelease()
Checks if is ban release.
|
boolean |
isBanSnapshots()
Checks if is ban snapshots.
|
boolean |
isBanTimestamps()
Checks if is ban timestamps.
|
protected boolean |
isSnapshot(String baseVersion)
Checks if is snapshot.
|
protected org.apache.maven.model.Plugin |
parsePluginString(String pluginString,
String field)
Helper method to parse and inject a Plugin.
|
Collection<org.apache.maven.model.Plugin> |
removeUncheckedPlugins(Collection<String> uncheckedPlugins,
Collection<org.apache.maven.model.Plugin> plugins)
Remove the plugins that the user doesn't want to check.
|
protected org.apache.maven.model.Plugin |
resolvePlugin(org.apache.maven.model.Plugin plugin,
org.apache.maven.project.MavenProject project)
Resolve plugin.
|
void |
setAdditionalPlugins(List<String> additionalPlugins) |
protected void |
setBanLatest(boolean theBanLatest)
Sets the ban latest.
|
protected void |
setBanRelease(boolean theBanRelease)
Sets the ban release.
|
void |
setBanSnapshots(boolean theBanSnapshots)
Sets the ban snapshots.
|
void |
setBanTimestamps(boolean theBanTimestamps)
Sets the ban timestamps.
|
void |
setPhases(String phases) |
void |
setUnCheckedPlugins(List unCheckedPlugins) |
protected void |
setUtils(EnforcerRuleUtils theUtils)
Sets the utils.
|
getCacheId, isCacheable, isResultValidgetMessage, setMessagepublic boolean banLatest
#setBanLatest(boolean)},
#isBanLatest()}public boolean banRelease
#setBanRelease(boolean)},
#isBanRelease()}public boolean banSnapshots
#setBanSnapshots(boolean)},
#isBanSnapshots()}public boolean banTimestamps
#setBanTimestamps(boolean)},
#isBanTimestamps()}public String phases
#setPhases(String)},
#getPhases()}public List<String> additionalPlugins
group:artifactId.#setAdditionalPlugins(List)},
#getAdditionalPlugins()}public List unCheckedPlugins
group:artifactId. NOTE: This is deprecated, use unCheckedPluginList instead.#setUnCheckedPlugins(List)},
#getUnCheckedPlugins()}public String unCheckedPluginList
group:artifactId,group2:artifactId2#setUnCheckedPlugins(List)},
#getUnCheckedPlugins()}public void execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper)
throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
org.apache.maven.enforcer.rule.api.EnforcerRuleExceptionpublic Collection<org.apache.maven.model.Plugin> removeUncheckedPlugins(Collection<String> uncheckedPlugins, Collection<org.apache.maven.model.Plugin> plugins) throws org.apache.maven.plugin.MojoExecutionException
uncheckedPlugins - plugins - org.apache.maven.plugin.MojoExecutionExceptionpublic Collection<String> combineUncheckedPlugins(Collection<String> uncheckedPlugins, String uncheckedPluginsList)
uncheckedPlugins - uncheckedPluginsList - public Set<org.apache.maven.model.Plugin> addAdditionalPlugins(Set<org.apache.maven.model.Plugin> existing, List<String> additional) throws org.apache.maven.plugin.MojoExecutionException
existing - the existingadditional - the additionalorg.apache.maven.plugin.MojoExecutionException - the mojo execution exceptionprotected org.apache.maven.model.Plugin parsePluginString(String pluginString, String field) throws org.apache.maven.plugin.MojoExecutionException
pluginString - field - org.apache.maven.plugin.MojoExecutionExceptionpublic Set<org.apache.maven.model.Plugin> getProfilePlugins(org.apache.maven.project.MavenProject project)
project - the projectprotected org.apache.maven.model.Plugin findCurrentPlugin(org.apache.maven.model.Plugin plugin,
org.apache.maven.project.MavenProject project)
plugin - plugin to lookupproject - project to searchnull if not found.protected org.apache.maven.model.Plugin resolvePlugin(org.apache.maven.model.Plugin plugin,
org.apache.maven.project.MavenProject project)
plugin - the pluginproject - the projectprotected Set<org.apache.maven.model.Plugin> getBoundPlugins(org.apache.maven.lifecycle.LifecycleExecutor life, org.apache.maven.project.MavenProject project, String thePhases) throws org.apache.maven.plugin.PluginNotFoundException, org.apache.maven.lifecycle.LifecycleExecutionException, IllegalAccessException
life - the lifeproject - the projectthePhases - the the phasesorg.apache.maven.plugin.PluginNotFoundException - the plugin not found exceptionorg.apache.maven.lifecycle.LifecycleExecutionException - the lifecycle execution exceptionIllegalAccessException - the illegal access exceptionprotected boolean hasValidVersionSpecified(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
List<PluginWrapper> pluginWrappers)
helper - the helpersource - the sourcepluginWrappers - the pluginsprotected boolean isSnapshot(String baseVersion)
baseVersion - the base versionpublic Map<String,org.apache.maven.lifecycle.Lifecycle> getPhaseToLifecycleMap() throws org.apache.maven.lifecycle.LifecycleExecutionException
org.apache.maven.lifecycle.LifecycleExecutionException - the lifecycle execution exceptionprotected List<PluginWrapper> getAllPluginEntries(org.apache.maven.project.MavenProject project) throws org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException, IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
project - the projectorg.apache.maven.artifact.resolver.ArtifactResolutionException - the artifact resolution exceptionorg.apache.maven.artifact.resolver.ArtifactNotFoundException - the artifact not found exceptionIOException - Signals that an I/O exception has occurred.org.codehaus.plexus.util.xml.pull.XmlPullParserException - the xml pull parser exceptionprotected boolean isBanLatest()
protected void setBanLatest(boolean theBanLatest)
theBanLatest - the banLatest to setprotected boolean isBanRelease()
protected void setBanRelease(boolean theBanRelease)
theBanRelease - the banRelease to setprotected EnforcerRuleUtils getUtils()
protected void setUtils(EnforcerRuleUtils theUtils)
theUtils - the utils to setpublic boolean isBanSnapshots()
public void setBanSnapshots(boolean theBanSnapshots)
theBanSnapshots - the banSnapshots to setpublic boolean isBanTimestamps()
public void setBanTimestamps(boolean theBanTimestamps)
theBanTimestamps - the banTimestamps to setpublic List getUnCheckedPlugins()
public void setUnCheckedPlugins(List unCheckedPlugins)
public final void setPhases(String phases)
public final String getPhases()
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.