Class MavenVersionMatchBuilder

java.lang.Object
de.softwareforge.testing.maven.MavenVersionMatchBuilder

public final class MavenVersionMatchBuilder extends Object
A builder class to control better what versions should be returned.
  • Method Details

    • partialMatch

      Support a partial match to the given version string. If the value is empty, any version will match. Otherwise, the version must be either exact or a prefix to match a version.
      Parameters:
      partial - The partial version to match.
      Returns:
      the builder
    • exactMatch

      Support an exact match to a version.
      Parameters:
      partial - The version to match.
      Returns:
      the builder
    • semVerMajor

      Supports semantic versioning, match the major version.
      Parameters:
      major - the major version to match.
      Returns:
      the builder
    • semVerMinor

      public MavenVersionMatchBuilder semVerMinor(int major, int minor)
      Supports semantic versioning, match the major and minor version.
      Parameters:
      major - the major version to match.
      minor - the minor version to match.
      Returns:
      the builder
    • extension

      Set the extension to consider. Default is "jar".
      Parameters:
      extension - Sets the extension.
      Returns:
      the builder
    • includeSnapshots

      public MavenVersionMatchBuilder includeSnapshots(boolean includeSnapshots)
      If true, snapshots are included in the results.
      Parameters:
      includeSnapshots - If true, include snapshots in the results. Default is true.
      Returns:
      the builder
    • findAll

      Returns a list of all versions that match the search constraints.
      Returns:
      A list of versions. This list may be empty but is never null.
      Throws:
      IOException - If the underlying code encounters an IO problem (e.g. no network connection).
    • findBestMatch

      Returns the best match for the given version contraints.
      Returns:
      The best match for the given version constraints. Can be Optional.empty() if no version matches.
      Throws:
      IOException - If the underlying code encounters an IO problem (e.g. no network connection).