java.lang.Object
org.basepom.mojo.dvc.strategy.AprVersionStrategy
- All Implemented Interfaces:
Strategy
- Direct Known Subclasses:
TwoDigitsBackwardCompatibleVersionStrategy
@Component(role=Strategy.class,
hint="apr")
public class AprVersionStrategy
extends Object
implements Strategy
Implements Apache versioning strategy for two or three digits. It expects versions formatted as x.y, x.y.z. Versions
can have an additional qualifier.
Version A (xa.ya.za) can replace Version B (xb.yb.zb) if xa == xb and xa >= xb. component z is always compatible.
If an additional qualifier exists, the qualifiers must match.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
checkMajorCompatible
(int expectedMajor, int resolvedMajor) protected int
checkMinorCompatible
(int expectedMinor, int resolvedMinor) protected int
checkPatchCompatible
(int expectedPatch, int resolvedPatch) protected int
checkQualifierCompatible
(String expectedQualifier, String resolvedQualifier) getName()
final boolean
isCompatible
(org.apache.maven.artifact.versioning.ComparableVersion expectedVersion, org.apache.maven.artifact.versioning.ComparableVersion resolvedVersion)
-
Field Details
-
LOG
-
-
Constructor Details
-
AprVersionStrategy
public AprVersionStrategy()
-
-
Method Details
-
getName
-
isCompatible
public final boolean isCompatible(org.apache.maven.artifact.versioning.ComparableVersion expectedVersion, org.apache.maven.artifact.versioning.ComparableVersion resolvedVersion) - Specified by:
isCompatible
in interfaceStrategy
- Parameters:
expectedVersion
- The artifact version expected (artifact version b).resolvedVersion
- The proposed artifact version (artifact version a).- Returns:
- True if an artifact with Version b can be replaced by an artifact with Version a.
-
checkMajorCompatible
protected int checkMajorCompatible(int expectedMajor, int resolvedMajor) -
checkMinorCompatible
protected int checkMinorCompatible(int expectedMinor, int resolvedMinor) -
checkPatchCompatible
protected int checkPatchCompatible(int expectedPatch, int resolvedPatch) -
checkQualifierCompatible
-