|
||||||||||
| 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<String> |
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<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(EnforcerRuleHelper helper)
|
protected org.apache.maven.model.Plugin |
findCurrentPlugin(org.apache.maven.model.Plugin plugin,
MavenProject project)
Given a plugin, this will retrieve the matching plugin artifact from the model. |
protected List<PluginWrapper> |
getAllPluginEntries(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(LifecycleExecutor life,
MavenProject project,
String thePhases)
Gets the plugins that are bound to the defined phases. |
protected String |
getMessage()
Gets the message. |
Map<String,Lifecycle> |
getPhaseToLifecycleMap()
Gets the phase to lifecycle map. |
Set<org.apache.maven.model.Plugin> |
getProfilePlugins(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<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,
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<String> 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
EnforcerRuleException
public Collection<org.apache.maven.model.Plugin> removeUncheckedPlugins(Collection<String> uncheckedPlugins,
Collection<org.apache.maven.model.Plugin> plugins)
throws MojoExecutionException
uncheckedPlugins - plugins -
MojoExecutionException
public 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 MojoExecutionException
existing - the existingadditional - the additional
MojoExecutionException - the mojo execution exception
protected org.apache.maven.model.Plugin parsePluginString(String pluginString,
String field)
throws MojoExecutionException
pluginString -
MojoExecutionExceptionpublic Set<org.apache.maven.model.Plugin> getProfilePlugins(MavenProject project)
project - the project
protected org.apache.maven.model.Plugin findCurrentPlugin(org.apache.maven.model.Plugin plugin,
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,
MavenProject project)
plugin - the pluginproject - the project
protected Set<org.apache.maven.model.Plugin> getBoundPlugins(LifecycleExecutor life,
MavenProject project,
String thePhases)
throws PluginNotFoundException,
LifecycleExecutionException,
IllegalAccessException
life - the lifeproject - the projectthePhases - the the phases
PluginNotFoundException - the plugin not found exception
LifecycleExecutionException - the lifecycle execution exception
IllegalAccessException - the illegal access exception
protected boolean hasValidVersionSpecified(EnforcerRuleHelper helper,
org.apache.maven.model.Plugin source,
List<PluginWrapper> pluginWrappers)
helper - the helpersource - the sourcepluginWrappers - the plugins
protected boolean isSnapshot(String baseVersion)
baseVersion - the base version
public Map<String,Lifecycle> getPhaseToLifecycleMap()
throws LifecycleExecutionException
LifecycleExecutionException - the lifecycle execution exception
protected List<PluginWrapper> getAllPluginEntries(MavenProject project)
throws ArtifactResolutionException,
ArtifactNotFoundException,
IOException,
XmlPullParserException
project - the project
ArtifactResolutionException - the artifact resolution exception
ArtifactNotFoundException - the artifact not found exception
IOException - Signals that an I/O exception has occurred.
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 | |||||||||