@Mojo(name="set",
aggregator=true,
threadSafe=true)
public class SetMojo
extends AbstractVersionsUpdaterMojo
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
nextSnapshot
Whether to add next version number and
-SNAPSHOT to the existing version. |
protected Integer |
nextSnapshotIndexToIncrement
Specifies the version index to increment when using
nextSnapshot. |
allowSnapshots, artifactMetadataSource, artifactResolver, ignoredVersions, localRepository, project, projectBuilder, reactorProjects, remoteArtifactRepositories, remotePluginRepositories, repositorySystem, ruleSet, session, settings| Constructor and Description |
|---|
SetMojo(org.apache.maven.repository.RepositorySystem repositorySystem,
org.apache.maven.project.MavenProjectBuilder projectBuilder,
org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource,
org.apache.maven.artifact.manager.WagonManager wagonManager,
org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver,
org.codehaus.plexus.components.interactivity.Prompter prompter) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Called when this mojo is executed.
|
protected String |
getIncrementedVersion(String version,
Integer nextSnapshotIndexToIncrement)
Returns the incremented version, with the nextSnapshotIndexToIncrement indicating the 1-based index,
from the left, or the most major version component, of the version string.
|
protected void |
update(ModifiedPomXMLEventReader pom)
Updates the pom file.
|
findLatestVersion, getChangeRecorder, getHelper, getProject, getPropertyValue, getVersion, newModifiedPomXER, process, saveChangeRecorderResults, setProject, shouldApplyUpdate, shouldApplyUpdate, updatePropertyToNewestVersion, writeFile@Parameter(property="nextSnapshot",
defaultValue="false")
protected boolean nextSnapshot
-SNAPSHOT to the existing version.
Unless specified by nextSnapshotIndexToIncrement, will increment
the last minor index of the snapshot version, e.g. the z in x.y.z-SNAPSHOT@Parameter(property="nextSnapshotIndexToIncrement") protected Integer nextSnapshotIndexToIncrement
Specifies the version index to increment when using nextSnapshot.
Will increment the (1-based, counting from the left, or the most major component) index
of the snapshot version, e.g. for -DnextSnapshotIndexToIncrement=1
and the version being 1.2.3-SNAPSHOT, the new version will become 2.2.3-SNAPSHOT.
Only valid with nextSnapshot.
@Inject
public SetMojo(org.apache.maven.repository.RepositorySystem repositorySystem,
org.apache.maven.project.MavenProjectBuilder projectBuilder,
org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource,
org.apache.maven.artifact.manager.WagonManager wagonManager,
org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver,
org.codehaus.plexus.components.interactivity.Prompter prompter)
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class AbstractVersionsUpdaterMojoorg.apache.maven.plugin.MojoExecutionException - when things go wrong.org.apache.maven.plugin.MojoFailureException - when things go wrong.protected String getIncrementedVersion(String version, Integer nextSnapshotIndexToIncrement) throws org.apache.maven.plugin.MojoExecutionException
version - input versionnextSnapshotIndexToIncrement - 1-based segment number to be incrementedorg.apache.maven.plugin.MojoExecutionException - thrown if the input parameters are invalidprotected void update(ModifiedPomXMLEventReader pom) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, XMLStreamException
update in class AbstractVersionsUpdaterMojopom - The pom file to update.org.apache.maven.plugin.MojoExecutionException - when things go wrong.org.apache.maven.plugin.MojoFailureException - when things go wrong.XMLStreamException - when things go wrong.Copyright © 2008–2022 MojoHaus. All rights reserved.