Package org.codehaus.mojo.versions.api
Class PropertyVersions
java.lang.Object
org.codehaus.mojo.versions.api.AbstractVersionDetails
org.codehaus.mojo.versions.api.PropertyVersions
- All Implemented Interfaces:
VersionDetails
Manages a property that is associated with one or more artifacts.
- Since:
- 1.0-alpha-3
- Author:
- Stephen Connolly
-
Field Summary
Fields inherited from class org.codehaus.mojo.versions.api.AbstractVersionDetails
verboseDetail -
Method Summary
Modifier and TypeMethodDescriptiongetName()org.apache.maven.artifact.versioning.ArtifactVersiongetNewestVersion(String versionString, Property property, boolean allowSnapshots, Collection<org.apache.maven.project.MavenProject> reactorProjects, VersionsHelper helper, boolean allowDowngrade, Optional<Segment> upperBoundSegment) Retrieves the newest artifact version for the given property-denoted artifact ornullif no newer version could be found.org.apache.maven.artifact.versioning.ArtifactVersiongetNewestVersion(String currentVersion, Property property, boolean allowSnapshots, List<org.apache.maven.project.MavenProject> reactorProjects, VersionsHelper helper) Gets the rule for version comparison of this artifact.org.apache.maven.artifact.versioning.ArtifactVersion[]getVersions(boolean includeSnapshots) Uses theDefaultVersionsHelperto find all available versions that match all the associations with this property.org.apache.maven.artifact.versioning.ArtifactVersion[]getVersions(Collection<org.apache.maven.artifact.Artifact> artifacts) Uses the suppliedCollectionofArtifactinstances to see if an ArtifactVersion can be provided.booleantoString()Methods inherited from class org.codehaus.mojo.versions.api.AbstractVersionDetails
containsVersion, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getCurrentVersion, getCurrentVersionRange, getHighestLowerBound, getLowerBound, getNewerVersions, getNewestUpdateWithinSegment, getNewestUpdateWithinSegment, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getReportNewestUpdate, getReportUpdates, getSelectedRestriction, getVersions, getVersions, getVersions, isVersionInRestriction, restrictionForIgnoreScope, restrictionForSelectedSegment, restrictionForUnchangedSegment, setCurrentVersion, setCurrentVersion, setCurrentVersionRange
-
Method Details
-
getVersionComparator
Gets the rule for version comparison of this artifact.- Returns:
- the rule for version comparison of this artifact.
- Since:
- 1.0-beta-1
-
getAssociations
-
getVersions
public org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(Collection<org.apache.maven.artifact.Artifact> artifacts) Uses the suppliedCollectionofArtifactinstances to see if an ArtifactVersion can be provided.- Parameters:
artifacts- TheCollectionofArtifactinstances .- Returns:
- The versions that can be resolved from the supplied Artifact instances or an empty array if no version can be resolved (i.e. the property is not associated with any of the supplied artifacts or the property is also associated to an artifact that has not been provided).
- Since:
- 1.0-alpha-3
-
getVersions
public org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(boolean includeSnapshots) Uses theDefaultVersionsHelperto find all available versions that match all the associations with this property.- Parameters:
includeSnapshots- Whether to include snapshot versions in our search.- Returns:
- The (possibly empty) array of versions.
-
getName
-
getProfileId
-
isAssociated
public boolean isAssociated() -
toString
-
getNewestVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(String currentVersion, Property property, boolean allowSnapshots, List<org.apache.maven.project.MavenProject> reactorProjects, VersionsHelper helper) throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException, InvalidSegmentException - Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationExceptionInvalidSegmentException
-
getNewestVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(String versionString, Property property, boolean allowSnapshots, Collection<org.apache.maven.project.MavenProject> reactorProjects, VersionsHelper helper, boolean allowDowngrade, Optional<Segment> upperBoundSegment) throws InvalidSegmentException, org.apache.maven.artifact.versioning.InvalidVersionSpecificationException Retrieves the newest artifact version for the given property-denoted artifact ornullif no newer version could be found.- Parameters:
versionString- current version of the artifactproperty- property name indicating the artifactallowSnapshots- whether snapshots should be consideredreactorProjects- collection of reactor projectshelper- VersionHelper objectallowDowngrade- whether downgrades should be allowedupperBoundSegment- the upper bound segment; empty() means no upper bound- Returns:
- newest artifact version fulfilling the criteria or null if no newer version could be found
- Throws:
InvalidSegmentException- thrown if theunchangedSegmentis not valid (e.g. greater than the number of segments in the version string)org.apache.maven.artifact.versioning.InvalidVersionSpecificationException- thrown if the version string in the property is not valid
-