Class MavenVersionComparator
java.lang.Object
network.ike.plugin.support.version.MavenVersionComparator
- All Implemented Interfaces:
Comparator<String>
Comparator that orders Maven version strings the same way Maven 4's
DefaultArtifactVersion does — broadly: split on
./-/_/digit-letter transitions, compare
numeric segments numerically, alpha segments lexicographically with
a few well-known qualifier ranks (alpha < beta < milestone <
rc < snapshot < (release) < sp).
This is a pragmatic re-implementation, not a full clone of
Maven's ComparableVersion. It handles the kinds of versions
IKE actually publishes (single-segment integer like "127";
dotted like "1.59.0"; SNAPSHOT-suffixed like
"128-SNAPSHOT") plus the common third-party patterns we
regularly upgrade against (e.g., JUnit
"5.11.4", asciidoctorj "3.0.1"). Using a hand-rolled
comparator avoids forcing every caller of
CandidateVersionResolver to depend on maven-artifact.
-
Field Summary
Fields -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
Shared instance.
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<String>
-