Simple VersionClassifierPlugin that happens to support a wide range of
versioning strategies, including semantic. Here are some details:
- Evolution paths are not supported;
- If the Version's are equal as per Version.equals, they are considered
equal;
- If the Version's are of different
VersionType, dynamic Version's
are considered greater than static Version's;
- If the Version's are dynamic, they are compared lexicographically;
- If the Version's are static they are expected to start with the prefix
defined within the STATIC_VERSION_PREFIX model property;
- If one version starts with the prefix and not the other, the one that does
is considered smaller;
- If no version start with the prefix, they are compared
lexicographically;
- If they both start with the prefix (or if no prefix is defined), they are
split into tokens on "." and "-";
- The tokens are considered in sequence;
- If 2 tokens to be compared are numeric, they are compared numerically;
- Otherwise they are compared lexicographically;
- As soon as 2 tokens to be compared are not deemed equal, the comparison
stops with the result of the comparison;
- If 2 tokens are equal, if they are both separated from the next token with
the same separator ("." or "-"), comparison continues with the following
tokens;
- If they are not separated with the same separator, the one which has the
"." separator is deemed greater than the other one;
- If one Version is out of tokens before the other, the one that has more
tokens is deemed greater.
Note that this resembles the comparison algorithm used by Maven (see
ComparableVersion)
but does not break tokens on transition between characters and digits, and does
not give special meaning to such tokens as "alpha", "beta", etc.