chore: MXTS-77488: build microdocs on gradle 9.6.1 / jdk 25 and cut 5.0.0 - #25
Conversation
Gradle 9 broke buildMicroDocs in two independent ways. Its Javadoc task now declares the service-injection getters abstract, so a concrete subclass no longer compiles; and Groovy 4 no longer resolves the Groovy-3-compiled dynamic super-dispatch to protected Javadoc.generate(), which surfaced at runtime as MissingMethodException: MicroDocs.generate(). @CompileStatic requires the CoreJavadocOptions local because getOptions() is declared to return MinimalJavadocOptions, which does not declare addStringOption; the cast is safe since the backing field is a StandardJavadocDocletOptions. The bytecode target is pinned explicitly because a Gradle 9 build silently moves it from major 52 to 65. Java 17 keeps every current consumer loadable. Verified end-to-end: buildMicroDocs succeeds in reallocation-engine-service against a mavenLocal publish of this build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bumps the Gradle wrapper 8.6 -> 9.6.1 and the convention plugin 3.3.2 -> 5.0.0-RC-3, which brings toolchain 25, and cuts the module as 5.0.0 in lockstep with its two siblings. The wrapper bump is a prerequisite, not a tidy-up: conventions 5.0.0-RC-3 is itself built with toolchain 25, so its plugin jar is major 69 and the Gradle daemon loading it must be JDK 25+ -- which Gradle 8.6 cannot provide.
Bumps the Gradle wrapper 8.6 -> 9.6.1, adds an explicit JDK 25 toolchain, cuts the module as 5.0.0, and repoints its microdocs-core-java dependency from the published 3.0.0 to 5.0.0. No API drift surfaced -- the module compiled against 5.0.0 with no source changes. This module deliberately does NOT adopt the convention plugin. Doing so would apply conventions' archiveBaseName of "app", renaming the fat jar and breaking the microdocs-crawler-doclet-all-*.jar glob that publish.sh line 18 depends on. An explicit toolchain reaches JDK 25 without that side effect.
Bumps the convention plugin 3.3.2 -> 5.0.0-RC-3, cuts the module as 5.0.0, repoints microdocs-core-java 3.0.0 -> 5.0.0 (regenerating gradle.lockfile to match), and adds mavenLocal() so that coordinate resolves before 5.0.0 is published to the registry. Drops the sourceCompatibility/targetCompatibility VERSION_17 pin added in fbc6c56, letting the bytecode target follow conventions' toolchain 25. The plugin moves from major 52 (published 4.0.2) to major 69. This is deliberate: microdocs 5.0.0 targets consumers already on JDK 25. The major version bump is what gates adoption -- config-server pins microdocs_version=4.+, which cannot resolve 5.0.0, so JDK 21 consumers stay on 4.0.2. Consuming builds of 5.0.0 need their Gradle daemon AND javadoc toolchain on JDK 25+.
There was a problem hiding this comment.
Pull request overview
This PR updates the MicroDocs Gradle plugin and its companion modules to build successfully on Gradle 9.6.1 with JDK 25, and aligns all module versions to 5.0.0 as part of the major-version/JDK-baseline bump.
Changes:
- Fix
MicroDocsJavadoc task subclassing for Gradle 9 + Groovy 4 (abstract class+@CompileStaticwithCoreJavadocOptionscast). - Upgrade Gradle wrappers to
9.6.1(including wrapper scripts anddistributionSha256Sum) across modules. - Bump module versions/dependencies to
5.0.0and update conventions plugin usage where applicable (plus local-resolution support for the unpublished core artifact).
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| microdocs-crawler-gradle/src/main/groovy/com/maxxton/microdocs/crawler/gradle/tasks/MicroDocs.groovy | Makes the custom Javadoc task compatible with Gradle 9/Groovy 4. |
| microdocs-crawler-gradle/gradlew.bat | Updates Gradle wrapper Windows script to Gradle 9 template. |
| microdocs-crawler-gradle/gradlew | Updates Gradle wrapper POSIX script to Gradle 9 template. |
| microdocs-crawler-gradle/gradle/wrapper/gradle-wrapper.properties | Bumps wrapper to Gradle 9.6.1 and adds SHA256 verification. |
| microdocs-crawler-gradle/gradle.properties | Bumps module version to 5.0.0. |
| microdocs-crawler-gradle/gradle.lockfile | Regenerates dependency lockfile for the new core dependency version. |
| microdocs-crawler-gradle/build.gradle | Updates conventions plugin version, adds mavenLocal(), bumps core dependency to 5.0.0. |
| microdocs-crawler-doclet/gradlew.bat | Updates Gradle wrapper Windows script to Gradle 9 template. |
| microdocs-crawler-doclet/gradlew | Updates Gradle wrapper POSIX script to Gradle 9 template. |
| microdocs-crawler-doclet/gradle/wrapper/gradle-wrapper.properties | Bumps wrapper to Gradle 9.6.1 and adds SHA256 verification. |
| microdocs-crawler-doclet/build.gradle | Bumps to 5.0.0 and sets a JDK 25 toolchain explicitly for the doclet build. |
| microdocs-core-java/gradlew.bat | Updates Gradle wrapper Windows script to Gradle 9 template. |
| microdocs-core-java/gradlew | Updates Gradle wrapper POSIX script to Gradle 9 template. |
| microdocs-core-java/gradle/wrapper/gradle-wrapper.properties | Bumps wrapper to Gradle 9.6.1 and adds SHA256 verification. |
| microdocs-core-java/gradle.properties | Bumps module version to 5.0.0. |
| microdocs-core-java/build.gradle | Updates conventions plugin version for the Gradle 9/JDK 25 baseline. |
Suppressed comments (1)
microdocs-crawler-gradle/build.gradle:20
mavenLocal()is currently the first repository. That makes dependency resolution non-reproducible (local artifacts can silently override the intended published ones) and can lead to CI/dev differences. Since the only reason to include it here is to pick up the unpublishedcom.maxxton:microdocs-core-java:5.0.0, it can be placed last without breaking that use case.
repositories {
mavenLocal()
mavenCentral()
maven {
url "artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-registry"
}
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (6)
Previously missed (3) — in code that hasn't changed since the last review.
microdocs-crawler-gradle/gradlew.bat:54
- This early error path does not actually stop the script.
"%COMSPEC%" /c exit 1only sets ERRORLEVEL in a childcmdand then execution falls through into:findJavaFromJavaHome/:execute, which can lead to confusing follow-on errors (and may even attempt to run with an empty JAVA_EXE). Use a batch-exit (exit /b 1) orgoto :eofhere.
This issue also appears on line 68 of the same file.
"%COMSPEC%" /c exit 1
microdocs-crawler-doclet/gradlew.bat:54
- This early error path does not actually stop the script.
"%COMSPEC%" /c exit 1exits only the childcmdand then the batch continues into:findJavaFromJavaHome/:execute, potentially attempting to run with an invalid JAVA_EXE. Useexit /b 1(orgoto :eof) to stop execution here.
This issue also appears on line 68 of the same file.
"%COMSPEC%" /c exit 1
microdocs-core-java/gradlew.bat:54
- This early error path does not stop the script.
"%COMSPEC%" /c exit 1runs in a child process and then the batch falls through into:findJavaFromJavaHome/:execute, which can cause misleading follow-on errors. Useexit /b 1(orgoto :eof) here to terminate the batch immediately.
This issue also appears on line 68 of the same file.
"%COMSPEC%" /c exit 1
microdocs-crawler-gradle/gradlew.bat:68
- Same as above: this error path falls through to
:executeafter setting ERRORLEVEL in a childcmd. It should exit the batch file immediately to avoid attempting to run Gradle with an invalid JAVA_EXE.
"%COMSPEC%" /c exit 1
microdocs-crawler-doclet/gradlew.bat:68
- Same fall-through issue here:
"%COMSPEC%" /c exit 1doesn't exit the batch file, so execution continues to:execute. Replace withexit /b 1to stop immediately on invalid JAVA_HOME.
"%COMSPEC%" /c exit 1
microdocs-core-java/gradlew.bat:68
- Same fall-through issue: this error path should exit the batch file immediately. As written, it continues to
:executeafter launching a childcmd. Replace withexit /b 1.
"%COMSPEC%" /c exit 1
Summary
buildMicroDocsfails on every Gradle 9 repo today. This fixes it and rebuilds theplugin for JDK 25, cut as 5.0.0.
Two independent Gradle 9 breakages, both in
MicroDocs.groovy(fbc6c56):Javadoc's service-injection getters abstract, so a concretesubclass no longer compiles ->
abstract class MicroDocs.protected
Javadoc.generate()->@CompileStatic(with aCoreJavadocOptionscast, since
getOptions()is declared to returnMinimalJavadocOptions).Then all three modules moved to Gradle 9.6.1 / JDK 25, with
microdocs-core-javaand
microdocs-crawler-gradleon maxxton-conventions5.0.0-RC-3, and all threecut to
5.0.0in lockstep.Consumer requirement (please read)
microdocs 5.0.0 requires the consuming build's Gradle daemon JVM AND javadoc
toolchain to be JDK 25+. The plugin's bytecode moves from major 52 to major 69.
This is deliberate. The major version bump is what gates adoption:
config-serverpinsmicrodocs_version=4.+, which cannot resolve5.0.0, so theJDK 21 consumers stay safely on 4.0.2. Note that maxxton-conventions sets the
toolchain, not the daemon JVM, so "consumer is on RC-3" does not imply its daemon
is 25 -- a consumer whose
JAVA_HOMEis still 21 fails at plugin-apply.This ships to nobody until two follow-ups land
maxxton-version-catalog/gradle/libs.versions.toml:15still pins
microdocs = "4.0.2"exactly, at every tag through v5.0.0.Notable decisions
archiveBaseNameto"app"on every Jar task, which would rename the fat jar andbreak the
microdocs-crawler-doclet-all-*.jarglob atpublish.sh:18. It gets anexplicit JDK 25 toolchain instead.
microdocs-crawler-gradlegainsmavenLocal()and a regeneratedgradle.lockfile,since both siblings now compile against
microdocs-core-java:5.0.0, which does notexist in the registry until the publish above.
Verification
No new unit tests -- build-configuration change with no behavioural code (these
modules have no test sources). Instead:
MicroDocsCrawlerPlugin,MicroDocs,DocletRunner, and core-java'sProject.publish.shembed step simulated -- the doclet glob matches exactly one file.buildMicroDocsgreen inreallocation-engine-serviceon JDK 25against the locally-published 5.0.0.
Known pre-existing issues (not addressed here)
MicroDocsCrawlerPluginreadsproject.sourceSetseagerly at apply time, so itmust be declared after
java/java-libraryin a consumer'splugins {}block.project.buildDirand thearchivesconfiguration are Gradle-10 removal candidates.microdocs-core-java.Ticket: MXTS-77488