|
||||||||||
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 | |
---|---|
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. |
String |
phases
The comma separated list of phases that should be used to find lifecycle plugin bindings. |
String |
unCheckedPluginList
Same as unCheckedPlugins but as a comma list to better support properties. |
List |
unCheckedPlugins
Deprecated. |
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule |
---|
message |
Constructor Summary | |
---|---|
RequirePluginVersions()
|
Method Summary | |
---|---|
Set |
addAdditionalPlugins(Set existing,
List additional)
Add the additional plugins if they don't exist yet. |
Collection |
combineUncheckedPlugins(Collection uncheckedPlugins,
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 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 Set |
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. |
protected String |
getMessage()
Gets the message. |
Map |
getPhaseToLifecycleMap()
Gets the phase to lifecycle map. |
Set |
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(EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
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(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 |
removeUncheckedPlugins(Collection uncheckedPlugins,
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(String theMessage)
Sets the message. |
void |
setUnCheckedPlugins(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 String phases
public List additionalPlugins
group:artifactId
.
public List unCheckedPlugins
group:artifactId
. NOTE: This is deprecated, use unCheckedPluginList instead.
public 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 exceptionpublic Collection removeUncheckedPlugins(Collection uncheckedPlugins, Collection plugins) throws org.apache.maven.plugin.MojoExecutionException
uncheckedPlugins
- plugins
-
org.apache.maven.plugin.MojoExecutionException
public Collection combineUncheckedPlugins(Collection uncheckedPlugins, String uncheckedPluginsList)
uncheckedPlugins
- uncheckedPluginsList
-
public Set addAdditionalPlugins(Set existing, List additional) throws org.apache.maven.plugin.MojoExecutionException
existing
- the existingadditional
- the additional
org.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
-
org.apache.maven.plugin.MojoExecutionException
public 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 Set 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 phases
org.apache.maven.plugin.PluginNotFoundException
- the plugin not found exception
org.apache.maven.lifecycle.LifecycleExecutionException
- the lifecycle execution exception
IllegalAccessException
- the illegal access exceptionprotected boolean hasValidVersionSpecified(EnforcerRuleHelper helper, org.apache.maven.model.Plugin source, List pluginWrappers)
helper
- the helpersource
- the sourcepluginWrappers
- the plugins
protected boolean isSnapshot(String baseVersion)
baseVersion
- the base version
public Map getPhaseToLifecycleMap() throws org.apache.maven.lifecycle.LifecycleExecutionException
org.apache.maven.lifecycle.LifecycleExecutionException
- the lifecycle execution exceptionprotected List 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 project
org.apache.maven.artifact.resolver.ArtifactResolutionException
- the artifact resolution exception
org.apache.maven.artifact.resolver.ArtifactNotFoundException
- the artifact not found exception
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 String getMessage()
protected void setMessage(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 List getUnCheckedPlugins()
public void setUnCheckedPlugins(List unCheckedPlugins)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |