Class AprVersionStrategy

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 Details

  • Constructor Details

    • AprVersionStrategy

      public AprVersionStrategy()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Strategy
      Returns:
      The name of the strategy.
    • isCompatible

      public final boolean isCompatible(org.apache.maven.artifact.versioning.ComparableVersion expectedVersion, org.apache.maven.artifact.versioning.ComparableVersion resolvedVersion)
      Specified by:
      isCompatible in interface Strategy
      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

      protected int checkQualifierCompatible(String expectedQualifier, String resolvedQualifier)