@Mojo(name="updateRegistry", defaultPhase=INSTALL, threadSafe=true) public class UpdatePluginRegistryMojo extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
artifactId
The artifact id of the project currently being built.
|
private java.lang.String |
groupId
The group id of the project currently being built.
|
private org.apache.maven.plugin.registry.MavenPluginRegistryBuilder |
pluginRegistryBuilder
Plexus component for retrieving the plugin registry info.
|
private boolean |
skip
Set this to "true" to skip invoking any goals or reports of the plugin.
|
private boolean |
skipUpdatePluginRegistry
Set this to "true" to skip updating the plugin registry.
|
private boolean |
usePluginRegistry
Indicates whether the
plugin-registry.xml file is used by Maven or not
to manage plugin versions. |
private java.lang.String |
version
The version of the project currently being built.
|
Constructor and Description |
---|
UpdatePluginRegistryMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
private org.apache.maven.plugin.registry.PluginRegistry |
getPluginRegistry(java.lang.String aGroupId,
java.lang.String anArtifactId) |
private void |
updatePluginVersionInRegistry(java.lang.String aGroupId,
java.lang.String anArtifactId,
java.lang.String aVersion) |
private void |
writeUserRegistry(java.lang.String aGroupId,
java.lang.String anArtifactId,
org.apache.maven.plugin.registry.PluginRegistry pluginRegistry) |
@Parameter(defaultValue="${settings.usePluginRegistry}", required=true, readonly=true) private boolean usePluginRegistry
plugin-registry.xml
file is used by Maven or not
to manage plugin versions.@Parameter(defaultValue="${project.groupId}", required=true, readonly=true) private java.lang.String groupId
@Parameter(defaultValue="${project.artifactId}", required=true, readonly=true) private java.lang.String artifactId
@Parameter(defaultValue="${project.artifact.version}", required=true, readonly=true) private java.lang.String version
@Component private org.apache.maven.plugin.registry.MavenPluginRegistryBuilder pluginRegistryBuilder
@Parameter(defaultValue="false", property="maven.plugin.skip") private boolean skip
@Parameter(defaultValue="false", property="maven.plugin.update.registry.skip") private boolean skipUpdatePluginRegistry
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
private void updatePluginVersionInRegistry(java.lang.String aGroupId, java.lang.String anArtifactId, java.lang.String aVersion) throws org.apache.maven.plugin.MojoExecutionException
aGroupId
- not nullanArtifactId
- not nullaVersion
- not nullorg.apache.maven.plugin.MojoExecutionException
- if anyprivate void writeUserRegistry(java.lang.String aGroupId, java.lang.String anArtifactId, org.apache.maven.plugin.registry.PluginRegistry pluginRegistry)
aGroupId
- not nullanArtifactId
- not nullpluginRegistry
- not nullprivate org.apache.maven.plugin.registry.PluginRegistry getPluginRegistry(java.lang.String aGroupId, java.lang.String anArtifactId) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
aGroupId
- not nullanArtifactId
- not nulljava.io.IOException
- if anyorg.codehaus.plexus.util.xml.pull.XmlPullParserException
- if any