Class DefaultVersionStrategy

java.lang.Object
org.basepom.mojo.dvc.strategy.DefaultVersionStrategy
All Implemented Interfaces:
Strategy

@Named("default") @Singleton public class DefaultVersionStrategy extends Object implements Strategy
This is the default versioning strategy used by previous versions of the plugin. It assumes that all smaller versions are compatible when replaced with larger numbers and compares version elements from left to right. E.g. 3.2.1 > 3.2 and 2.1.1 > 1.0. Usually works pretty ok.
  • Constructor Details

  • 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.