boot-versions: list release dates and latest patches back to 2.0

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7N4ZDbUtA3ofqAqRV
This commit is contained in:
Claude
2026-12-03 09:33:17 +05:30
parent 2a8219a6ee
commit a95f042051
3 changed files with 28 additions and 17 deletions
@@ -25,7 +25,7 @@ import org.w3c.dom.Node;
public final class Central {
static final String REPO = "https://repo1.maven.org/maven2/";
private static final Pattern GA = Pattern.compile("\\d+\\.\\d+\\.\\d+");
private static final Pattern GA = Pattern.compile("\\d+\\.\\d+\\.\\d+(\\.RELEASE)?");
private final HttpClient http = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NORMAL)
@@ -72,7 +72,7 @@ public final class Central {
.withZoneSameInstant(ZoneOffset.UTC).toLocalDate();
}
/** All GA versions (no -M, -RC, -SNAPSHOT) of an artifact, oldest first. */
/** All GA versions (no -M, -RC, -SNAPSHOT; up to 2.3 they end in .RELEASE), oldest first. */
public List<String> gaVersions(String groupPath, String artifact) throws Exception {
Document doc = xml(text(REPO + groupPath + "/" + artifact + "/maven-metadata.xml").getBytes());
var nodes = doc.getElementsByTagName("version");
@@ -21,7 +21,7 @@ import tools.jackson.databind.json.JsonMapper;
*/
public final class VersionReport {
static final List<String> LINES = List.of("2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "3.5", "4.0", "4.1", "4.2");
static final List<String> LINES = List.of("2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "3.5", "4.0", "4.1", "4.2");
private static final String BOOT = "org/springframework/boot/";
private static final String API = "https://api.spring.io/projects/spring-boot/generations";
@@ -59,11 +59,12 @@ public final class VersionReport {
List<String> all = central.gaVersions("org/springframework/boot", "spring-boot-dependencies");
System.out.println("# Maven Central, org.springframework.boot:spring-boot-dependencies, read on " + today);
System.out.println("latest GA overall: " + all.getLast());
System.out.printf("%-6s %-12s %-14s %-13s %s%n", "line", "x.y.0 date", "latest patch", "patch date", "patches");
System.out.printf("%-6s %-12s %-16s %-13s %s%n", "line", "x.y.0 date", "latest patch", "patch date", "patches");
for (var e : latestPatchPerLine().entrySet()) {
long count = all.stream().filter(v -> v.startsWith(e.getKey() + ".")).count();
System.out.printf("%-6s %-12s %-14s %-13s %d%n", e.getKey(),
central.publishedOn(pom(e.getKey() + ".0")), e.getValue(),
String first = all.contains(e.getKey() + ".0") ? e.getKey() + ".0" : e.getKey() + ".0.RELEASE";
System.out.printf("%-6s %-12s %-16s %-13s %d%n", e.getKey(),
central.publishedOn(pom(first)), e.getValue(),
central.publishedOn(pom(e.getValue())), count);
}
}
@@ -120,6 +121,9 @@ public final class VersionReport {
System.out.printf("%-8s %-6s %-12s %-10s %-9s %-10s %-9s %-8s %s%n", "boot", "major", "docs Java",
"framework", "tomcat", "jackson", "hibernate", "junit", "jooq");
for (var e : latestPatchPerLine().entrySet()) {
if (e.getKey().compareTo("2.7") < 0) {
continue;
}
String v = e.getValue();
Bom bom = Bom.read(central, v);
String jackson = bom.properties().containsKey("jackson-bom.version")