diff --git a/documentation/src/content/downloads.adoc b/documentation/src/content/downloads.adoc index 2d4ac1e..463b46f 100644 --- a/documentation/src/content/downloads.adoc +++ b/documentation/src/content/downloads.adoc @@ -21,7 +21,8 @@ License under Apache License v2 (ALv2). [.table.table-bordered,options="header"] |=== |Name|Version|Date|Size|Type|Links -|Arthur Source Release|1.0.6|2022-04-21 20:37:59|575 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip.asc[icon:download[] asc] +|Arthur Source Release|1.0.7|2023-08-18 14:45:58|576 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.7/arthur-1.0.7-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.7/arthur-1.0.7-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.7/arthur-1.0.7-source-release.zip.asc[icon:download[] asc] +|Arthur Source Release|1.0.6|2023-04-17 18:37:59|575 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.6/arthur-1.0.6-source-release.zip.asc[icon:download[] asc] |Arthur Source Release|1.0.5|2022-02-14 17:00:24|574 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.5/arthur-1.0.5-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.5/arthur-1.0.5-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.5/arthur-1.0.5-source-release.zip.asc[icon:download[] asc] |Arthur Source Release|1.0.4|2022-01-26 10:47:39|573 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.4/arthur-1.0.4-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.4/arthur-1.0.4-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.4/arthur-1.0.4-source-release.zip.asc[icon:download[] asc] |Arthur Source Release|1.0.3|2021-08-30 15:08:48|573 kB|zip|https://repo.maven.apache.org/maven2/org/apache/geronimo/arthur/arthur/1.0.3/arthur-1.0.3-source-release.zip[icon:download[] zip] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.3/arthur-1.0.3-source-release.zip.sha1[icon:download[] sha1] https://repository.apache.org/content/repositories/releases/org/apache/geronimo/arthur/arthur/1.0.3/arthur-1.0.3-source-release.zip.asc[icon:download[] asc] diff --git a/documentation/src/main/java/org/apache/geronimo/arthur/documentation/download/Downloads.java b/documentation/src/main/java/org/apache/geronimo/arthur/documentation/download/Downloads.java index 73111c1..9d186e2 100755 --- a/documentation/src/main/java/org/apache/geronimo/arthur/documentation/download/Downloads.java +++ b/documentation/src/main/java/org/apache/geronimo/arthur/documentation/download/Downloads.java @@ -33,6 +33,7 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collection; +import java.util.Comparator; import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; @@ -70,10 +71,9 @@ public void update(final PrintStream stream) { .map(v -> v.extensions("zip")) .map(v -> v.classifiers("source-release")) .flatMap(this::toDownloadable) - .parallel() .map(this::fillDownloadable) .filter(Objects::nonNull) - .sorted(this::compareVersions) + .sorted(Comparator.comparing(it -> it.date).reversed()) .map(it -> toDownloadLine(dateFormatter, it)) .forEach(stream::println); stream.println("|===\n"); @@ -91,51 +91,6 @@ private String toDownloadLine(final DateTimeFormatter dateFormatter, final Downl d.asc + "[icon:download[] asc]"; } - private int compareVersions(final Download o1, final Download o2) { - final int versionComp = o2.version.compareTo(o1.version); - if (versionComp != 0) { - if (o2.version.startsWith(o1.version) && o2.version.contains("-M")) { // milestone - return -1; - } - if (o1.version.startsWith(o2.version) && o1.version.contains("-M")) { // milestone - return 1; - } - - final String[] v1 = o1.version.split("\\."); - final String[] v2 = o2.version.split("\\."); - for (int i = 0; i < Math.max(v1.length, v2.length); i++) { - if (v1.length == i) { - return 1; - } - if (v2.length == i) { - return -1; - } - try { - final int diff = Integer.parseInt(v2[i]) - Integer.parseInt(v1[i]); - if (diff != 0) { - return diff; - } - } catch (final NumberFormatException nfe) { - break; // use plain string comparison - } - } - - return versionComp; - } - - final int nameComp = o1.name.compareTo(o2.name); - if (nameComp != 0) { - return nameComp; - } - - final long dateComp = o2.date.compareTo(o1.date); - if (dateComp != 0) { - return (int) dateComp; - } - - return o1.url.compareTo(o2.url); - } - private void printHeader(final PrintStream stream) { stream.println( "////\n" +