@@ -483,7 +483,7 @@ private HashMap<String, String> loadKnownHttpStatusMap() {
483
483
}
484
484
485
485
private void setHelidonVersion (String version ) {
486
- helidonVersion = VersionUtil .instance ().chooseVersion (version );
486
+ helidonVersion = VersionUtil .instance ().chooseVersionBestMatchOrSelf (version );
487
487
setParentVersion (helidonVersion );
488
488
helidonMajorVersion = VersionUtil .majorVersion (helidonVersion );
489
489
}
@@ -769,6 +769,30 @@ String chooseVersion(String requestedVersion) {
769
769
return chooseVersion (requestedVersion , versions );
770
770
}
771
771
772
+ /**
773
+ * Returns either the best match version of, if there is none, the requested version itself to allow references to
774
+ * unpublished releases such as snapshots.
775
+ *
776
+ * @param requestedVersion version to search for
777
+ * @return either the best match or, if none, the requested version itself
778
+ */
779
+ String chooseVersionBestMatchOrSelf (String requestedVersion ) {
780
+ return chooseVersionBestMatchOrSelf (requestedVersion , versions );
781
+ }
782
+
783
+ /**
784
+ * Returns either the best match version of, if there is none, the requested version itself to allow references to
785
+ * unpublished releases such as snapshots.
786
+ *
787
+ * @param requestedVersion version to search for
788
+ * @param candidateVersions releases to consider
789
+ * @return either the best match or, if none, the requested version itself
790
+ */
791
+ String chooseVersionBestMatchOrSelf (String requestedVersion , List <String > candidateVersions ) {
792
+ String bestMatch = chooseVersion (requestedVersion , candidateVersions );
793
+ return bestMatch != null ? bestMatch : requestedVersion ;
794
+ }
795
+
772
796
/**
773
797
* Returns the version that is the "closest" match to the requested version expression from among the provided
774
798
* releases, where the expression expression is one of the following:
0 commit comments