|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
org.apache.maven.plugins.enforcer.RequirePluginVersions
public class RequirePluginVersions
This rule will enforce that all plugins specified in the poms have a version declared.
| Field Summary | |
|---|---|
java.util.List |
additionalPlugins
Additional plugins to enforce have versions. |
boolean |
banLatest
Don't allow the LATEST identifier. |
boolean |
banRelease
Don't allow the RELEASE identifier. |
boolean |
banSnapshots
Don't allow snapshot plugins. |
boolean |
banTimestamps
Don't allow timestamp snapshot plugins. |
java.lang.String |
phases
The comma separated list of phases that should be used to find lifecycle plugin bindings. |
java.lang.String |
unCheckedPluginList
Same as unCheckedPlugins but as a comma list to better support properties. |
java.util.List |
unCheckedPlugins
Deprecated. |
| Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule |
|---|
message |
| Constructor Summary | |
|---|---|
RequirePluginVersions()
|
|
| Method Summary | |
|---|---|
java.util.Set |
addAdditionalPlugins(java.util.Set existing,
java.util.List additional)
Add the additional plugins if they don't exist yet. |
java.util.Collection |
combineUncheckedPlugins(java.util.Collection uncheckedPlugins,
java.lang.String uncheckedPluginsList)
Combines the old Collection with the new comma separated list. |
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule. |
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. |
protected java.util.List |
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 java.util.Set |
getBoundPlugins(org.apache.maven.lifecycle.LifecycleExecutor life,
org.apache.maven.project.MavenProject project,
java.lang.String thePhases)
Gets the plugins that are bound to the defined phases. |
protected java.lang.String |
getMessage()
Gets the message. |
java.util.Map |
getPhaseToLifecycleMap()
Gets the phase to lifecycle map. |
java.util.Set |
getProfilePlugins(org.apache.maven.project.MavenProject project)
Finds the plugins that are listed in active profiles. |
java.util.List |
getUnCheckedPlugins()
|
protected EnforcerRuleUtils |
getUtils()
Gets the utils. |
protected boolean |
hasValidVersionSpecified(EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
java.util.List 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(java.lang.String baseVersion)
Checks if is snapshot. |
protected org.apache.maven.model.Plugin |
parsePluginString(java.lang.String pluginString,
java.lang.String field)
Helper method to parse and inject a Plugin. |
java.util.Collection |
removeUncheckedPlugins(java.util.Collection uncheckedPlugins,
java.util.Collection 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. |
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. |
protected void |
setMessage(java.lang.String theMessage)
Sets the message. |
void |
setUnCheckedPlugins(java.util.List unCheckedPlugins)
|
protected void |
setUtils(EnforcerRuleUtils theUtils)
Sets the utils. |
| 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 |
|---|
public boolean banLatest
public boolean banRelease
public boolean banSnapshots
public boolean banTimestamps
public java.lang.String phases
public java.util.List additionalPlugins
group:artifactId.
public java.util.List unCheckedPlugins
group:artifactId. NOTE: This is deprecated, use unCheckedPluginList instead.
public java.lang.String unCheckedPluginList
group:artifactId,group2:artifactId2
| Constructor Detail |
|---|
public RequirePluginVersions()
| Method Detail |
|---|
public void execute(EnforcerRuleHelper helper)
throws EnforcerRuleException
EnforcerRule
helper - The helper provides access to the log, MavenSession and has
helpers to get common components. It is also able to lookup components
by class name.
EnforcerRuleException - the enforcer rule exception
public java.util.Collection removeUncheckedPlugins(java.util.Collection uncheckedPlugins,
java.util.Collection plugins)
throws org.apache.maven.plugin.MojoExecutionException
uncheckedPlugins - plugins -
org.apache.maven.plugin.MojoExecutionException
public java.util.Collection combineUncheckedPlugins(java.util.Collection uncheckedPlugins,
java.lang.String uncheckedPluginsList)
uncheckedPlugins - uncheckedPluginsList -
public java.util.Set addAdditionalPlugins(java.util.Set existing,
java.util.List additional)
throws org.apache.maven.plugin.MojoExecutionException
existing - the existingadditional - the additional
org.apache.maven.plugin.MojoExecutionException - the mojo execution exception
protected org.apache.maven.model.Plugin parsePluginString(java.lang.String pluginString,
java.lang.String field)
throws org.apache.maven.plugin.MojoExecutionException
pluginString -
org.apache.maven.plugin.MojoExecutionExceptionpublic java.util.Set getProfilePlugins(org.apache.maven.project.MavenProject project)
project - the project
protected org.apache.maven.model.Plugin findCurrentPlugin(org.apache.maven.model.Plugin plugin,
org.apache.maven.project.MavenProject project)
plugin - plugin to lookupproject - project to search
null 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 project
protected java.util.Set getBoundPlugins(org.apache.maven.lifecycle.LifecycleExecutor life,
org.apache.maven.project.MavenProject project,
java.lang.String thePhases)
throws org.apache.maven.plugin.PluginNotFoundException,
org.apache.maven.lifecycle.LifecycleExecutionException,
java.lang.IllegalAccessException
life - the lifeproject - the projectthePhases - the the phases
org.apache.maven.plugin.PluginNotFoundException - the plugin not found exception
org.apache.maven.lifecycle.LifecycleExecutionException - the lifecycle execution exception
java.lang.IllegalAccessException - the illegal access exception
protected boolean hasValidVersionSpecified(EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
java.util.List pluginWrappers)
helper - the helpersource - the sourcepluginWrappers - the plugins
protected boolean isSnapshot(java.lang.String baseVersion)
baseVersion - the base version
public java.util.Map getPhaseToLifecycleMap()
throws org.apache.maven.lifecycle.LifecycleExecutionException
org.apache.maven.lifecycle.LifecycleExecutionException - the lifecycle execution exception
protected java.util.List getAllPluginEntries(org.apache.maven.project.MavenProject project)
throws org.apache.maven.artifact.resolver.ArtifactResolutionException,
org.apache.maven.artifact.resolver.ArtifactNotFoundException,
java.io.IOException,
org.codehaus.plexus.util.xml.pull.XmlPullParserException
project - the project
org.apache.maven.artifact.resolver.ArtifactResolutionException - the artifact resolution exception
org.apache.maven.artifact.resolver.ArtifactNotFoundException - the artifact not found exception
java.io.IOException - 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 java.lang.String getMessage()
protected void setMessage(java.lang.String theMessage)
theMessage - the message 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 java.util.List getUnCheckedPlugins()
public void setUnCheckedPlugins(java.util.List unCheckedPlugins)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||