Module org.basepom.mojo.dvc
Package org.basepom.mojo.dvc.strategy
Class TwoDigitsBackwardCompatibleVersionStrategy
java.lang.Object
org.basepom.mojo.dvc.strategy.AprVersionStrategy
org.basepom.mojo.dvc.strategy.TwoDigitsBackwardCompatibleVersionStrategy
- All Implemented Interfaces:
Strategy
@Component(role=Strategy.class,
hint="two-digits-backward-compatible")
public class TwoDigitsBackwardCompatibleVersionStrategy
extends AprVersionStrategy
Relaxed variant of APR, very suitable for Java code. It is assumed that for every non-backwards compatible change, the artifactId
is changed (e.g. by attaching a number to the artifactId) and the code is repackaged into a different package. So it is possible to
have multiple, non-backwards compatible major versions on the classpath (foo vs. foo2 vs.foo3). So all versions with the same artifactId
are backwards compatible; only forwards compatibility must be ensured.
By using the APR parser, the major version flags forwards compatibility, the minor and patch are not used. If a qualifier is present, it must match.
-
Field Summary
Fields inherited from class org.basepom.mojo.dvc.strategy.AprVersionStrategy
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcheckMajorCompatible(int expectedMajor, int resolvedMajor) protected intcheckMinorCompatible(int expectedMinor, int resolvedMinor) protected intcheckPatchCompatible(int expectedPatch, int resolvedPatch) getName()Methods inherited from class org.basepom.mojo.dvc.strategy.AprVersionStrategy
checkQualifierCompatible, isCompatible
-
Constructor Details
-
TwoDigitsBackwardCompatibleVersionStrategy
public TwoDigitsBackwardCompatibleVersionStrategy()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceStrategy- Overrides:
getNamein classAprVersionStrategy- Returns:
- The name of the strategy.
-
checkMajorCompatible
protected int checkMajorCompatible(int expectedMajor, int resolvedMajor) - Overrides:
checkMajorCompatiblein classAprVersionStrategy
-
checkMinorCompatible
protected int checkMinorCompatible(int expectedMinor, int resolvedMinor) - Overrides:
checkMinorCompatiblein classAprVersionStrategy
-
checkPatchCompatible
protected int checkPatchCompatible(int expectedPatch, int resolvedPatch) - Overrides:
checkPatchCompatiblein classAprVersionStrategy
-