Package de.softwareforge.testing.maven
Class MavenVersionMatchBuilder
java.lang.Object
de.softwareforge.testing.maven.MavenVersionMatchBuilder
A builder class to control better what versions should be returned.
-
Method Summary
Modifier and TypeMethodDescriptionexactMatch(String partial) Support an exact match to a version.Set the extension to consider.findAll()Returns a list of all versions that match the search constraints.Returns the best match for the given version contraints.includeSnapshots(boolean includeSnapshots) If true, snapshots are included in the results.partialMatch(String partial) Support a partial match to the given version string.semVerMajor(int major) Supports semantic versioning, match the major version.semVerMinor(int major, int minor) Supports semantic versioning, match the major and minor version.
-
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
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
If true, snapshots are included in the results.- Parameters:
includeSnapshots- If true, include snapshots in the results. Default istrue.- 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).
-