Package org.codehaus.mojo.versions
Class UpdateParentMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo
org.codehaus.mojo.versions.UpdateParentMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="update-parent",
threadSafe=true)
public class UpdateParentMojo
extends AbstractVersionsUpdaterMojo
Sets the parent version to the latest parent version.
- Since:
- 1.0-alpha-1
- Author:
- Stephen Connolly
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to downgrade a snapshot dependency ifallowSnapshotsisfalseand there exists a version within the range fulfilling the criteria.protected booleanWhether to allow the incremental version number to be changed.protected booleanWhether to allow the major version number to be changed.protected booleanWhether to allow the minor version number to be changed.protected booleanto update parent version by force when it is RELEASE or LATESTprotected StringIfskipResolutionis not set, specifies the bottom version considered for target version resolution.protected booleanSkips version resolution, only valid ifparentVersionis set.Fields inherited from class org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo
allowSnapshots, artifactHandlerManager, generateBackupPoms, ignoredVersions, project, reactorProjects, repositorySystem, ruleSet, session, wagonMapFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionUpdateParentMojo(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.eclipse.aether.RepositorySystem repositorySystem, Map<String, org.apache.maven.wagon.Wagon> wagonMap, Map<String, ChangeRecorder> changeRecorders) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.artifact.versioning.ArtifactVersionprotected voidUpdates the pom.Methods inherited from class org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo
execute, findLatestVersion, getChangeRecorder, getHelper, getProject, getVersion, process, saveChangeRecorderResults, setProject, shouldApplyUpdate, shouldApplyUpdate, updatePropertyToNewestVersion, validateInputMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
parentVersion
If
skipResolutionis not set, specifies the bottom version considered for target version resolution. If it is a version range, the resolved version will be restricted by that range.If
skipResolutionistrue, will specify the target version to which the parent artifact will be updated.- Since:
- 1.0-alpha-1
-
forceUpdate
@Parameter(property="forceUpdate", defaultValue="false") protected boolean forceUpdateto update parent version by force when it is RELEASE or LATEST- Since:
- 2.9
-
skipResolution
@Parameter(property="skipResolution", defaultValue="false") protected boolean skipResolutionSkips version resolution, only valid ifparentVersionis set. Will effectively set the new parent version to the one fromparentVersion- Since:
- 2.13.0
-
allowDowngrade
@Parameter(property="allowDowngrade", defaultValue="false") protected boolean allowDowngradeWhether to downgrade a snapshot dependency if
allowSnapshotsisfalseand there exists a version within the range fulfilling the criteria.Default
false- Since:
- 2.12.0
-
allowMajorUpdates
@Parameter(property="allowMajorUpdates", defaultValue="true") protected boolean allowMajorUpdatesWhether to allow the major version number to be changed.- Since:
- 2.13.0
-
allowMinorUpdates
@Parameter(property="allowMinorUpdates", defaultValue="true") protected boolean allowMinorUpdatesWhether to allow the minor version number to be changed.
Note:
falsealso implies allowMajorUpdatesfalse- Since:
- 2.13.0
-
allowIncrementalUpdates
@Parameter(property="allowIncrementalUpdates", defaultValue="true") protected boolean allowIncrementalUpdatesWhether to allow the incremental version number to be changed.
Note:
falsealso implies allowMajorUpdates and allowMinorUpdatesfalse- Since:
- 2.13.0
-
-
Constructor Details
-
UpdateParentMojo
@Inject public UpdateParentMojo(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.eclipse.aether.RepositorySystem repositorySystem, Map<String, org.apache.maven.wagon.Wagon> wagonMap, Map<String, ChangeRecorder> changeRecorders)
-
-
Method Details
-
update
protected void update(MutableXMLStreamReader pom) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, XMLStreamException, VersionRetrievalException Description copied from class:AbstractVersionsUpdaterMojoUpdates the pom.- Specified by:
updatein classAbstractVersionsUpdaterMojo- Parameters:
pom- the pom to update.- Throws:
org.apache.maven.plugin.MojoExecutionException- when things go wrongorg.apache.maven.plugin.MojoFailureException- when things go wrong in a very bad wayXMLStreamException- when things go wrong with XML streamingVersionRetrievalException- if version retrieval goes wrong- Since:
- 1.0-alpha-1
- See Also:
-
resolveTargetVersion
protected org.apache.maven.artifact.versioning.ArtifactVersion resolveTargetVersion() throws org.apache.maven.plugin.MojoExecutionException, VersionRetrievalException, org.apache.maven.artifact.versioning.InvalidVersionSpecificationException, InvalidSegmentException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionVersionRetrievalExceptionorg.apache.maven.artifact.versioning.InvalidVersionSpecificationExceptionInvalidSegmentException
-