|
37 | 37 | import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
38 | 38 | import org.apache.maven.artifact.resolver.ArtifactResolver;
|
39 | 39 | import org.apache.maven.artifact.versioning.ArtifactVersion;
|
| 40 | +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; |
40 | 41 | import org.apache.maven.artifact.versioning.VersionRange;
|
41 | 42 | import org.apache.maven.execution.MavenSession;
|
42 | 43 | import org.apache.maven.plugin.AbstractMojo;
|
|
54 | 55 | import org.codehaus.mojo.versions.api.PomHelper;
|
55 | 56 | import org.codehaus.mojo.versions.api.PropertyVersions;
|
56 | 57 | import org.codehaus.mojo.versions.api.VersionsHelper;
|
| 58 | +import org.codehaus.mojo.versions.ordering.InvalidSegmentException; |
57 | 59 | import org.codehaus.mojo.versions.recording.ChangeRecorder;
|
58 | 60 | import org.codehaus.mojo.versions.recording.ChangeRecorderNull;
|
59 | 61 | import org.codehaus.mojo.versions.recording.ChangeRecorderXML;
|
@@ -101,7 +103,7 @@ public abstract class AbstractVersionsUpdaterMojo
|
101 | 103 | * @since 1.0-alpha-1
|
102 | 104 | */
|
103 | 105 | @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
|
104 |
| - protected List reactorProjects; |
| 106 | + protected List<MavenProject> reactorProjects; |
105 | 107 |
|
106 | 108 | /**
|
107 | 109 | * The artifact metadata source to use.
|
@@ -216,8 +218,7 @@ public abstract class AbstractVersionsUpdaterMojo
|
216 | 218 |
|
217 | 219 | // --------------------- GETTER / SETTER METHODS ---------------------
|
218 | 220 |
|
219 |
| - public VersionsHelper getHelper() |
220 |
| - throws MojoExecutionException |
| 221 | + public VersionsHelper getHelper() throws MojoExecutionException |
221 | 222 | {
|
222 | 223 | if ( helper == null )
|
223 | 224 | {
|
@@ -514,13 +515,22 @@ protected boolean shouldApplyUpdate( Artifact artifact, String currentVersion, A
|
514 | 515 | }
|
515 | 516 |
|
516 | 517 | /**
|
517 |
| - * Based on the passed flags, determines which segment is unchangable. This can be used when determining an upper |
| 518 | + * <p>Based on the passed flags, determines which segment (0-based), which is not to be changed.</p> |
| 519 | + * <p>The method will return, depending on the first parameter on the list to be true: |
| 520 | + * <ul> |
| 521 | + * <li>{@code allowMajorUpdates}: -1</li> |
| 522 | + * <li>{@code allowMinorUpdates}: 0</li> |
| 523 | + * <li>{@code allowIncrementalUpdates}: 1</li> |
| 524 | + * <li>(none): 2</li> |
| 525 | + * </ul> |
| 526 | + * |
| 527 | + * This can be used when determining an upper |
518 | 528 | * bound for the "latest" version.
|
519 | 529 | *
|
520 | 530 | * @param allowMajorUpdates Allow major updates
|
521 | 531 | * @param allowMinorUpdates Allow minor updates
|
522 | 532 | * @param allowIncrementalUpdates Allow incremental updates
|
523 |
| - * @return Returns the segment that is unchangable. If any segment can change, returns -1. |
| 533 | + * @return Returns the segment (0-based) that is unchangable. If any segment can change, returns -1. |
524 | 534 | */
|
525 | 535 | protected int determineUnchangedSegment( boolean allowMajorUpdates, boolean allowMinorUpdates,
|
526 | 536 | boolean allowIncrementalUpdates )
|
@@ -553,7 +563,8 @@ else if ( allowIncrementalUpdates )
|
553 | 563 | protected ArtifactVersion updatePropertyToNewestVersion( ModifiedPomXMLEventReader pom, Property property,
|
554 | 564 | PropertyVersions version, String currentVersion,
|
555 | 565 | boolean allowDowngrade, int segment )
|
556 |
| - throws MojoExecutionException, XMLStreamException |
| 566 | + throws XMLStreamException, InvalidVersionSpecificationException, |
| 567 | + InvalidSegmentException, MojoExecutionException |
557 | 568 | {
|
558 | 569 | ArtifactVersion winner =
|
559 | 570 | version.getNewestVersion( currentVersion, property, this.allowSnapshots, this.reactorProjects,
|
|
0 commit comments