[MINOR] Run delombok only in the release profile - #884
Open
slachiewicz wants to merge 1 commit into
Open
Conversation
The delombok output has exactly one consumer: maven-javadoc-plugin in
the release profile, which reads ${delombok.output.dir} so that the
lombok-generated builders, getters and equals/hashCode appear in the
javadoc jar. There is no <reporting> section and the website build is
Docusaurus, so nothing else looks at it.
The execution itself sat in <build><plugins> bound to generate-sources,
so it ran on every build - every CI run and every local install - to
produce a directory that only a release ever reads. Move it next to its
consumer.
This keeps the javadoc jars intact, so it is not a repeat of apache#728, which
removed the plugin outright and left the javadoc jar empty until apache#854
restored it. Verified below.
It also takes lombok-maven-plugin off the path of ordinary builds. Its
last release is 1.18.20.0 (April 2021) and it cannot delombok on JDK 21+,
so today every contributor pays for a plugin whose output they never use.
Note this removes one of three independent JDK 21 blockers - spotless
(google-java-format 1.10.0 < 1.17.0) and a javac-21 inference failure in
xtable-core remain, so this alone does not make the build JDK 21 ready.
Verified on Temurin 11 with the project's wrapper:
- ./mvnw install -DskipTests -> 0 delombok executions, BUILD SUCCESS
- ./mvnw package -DdeployArtifacts=true -> 10 delombok executions, 6 javadoc
jars, and InternalTable.html documents
builder(), the generated
InternalTableBuilder class, the getters
and equals/hashCode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the pull request
Run
delombokonly where its output is actually used.${delombok.output.dir}has exactly one consumer:maven-javadoc-pluginin thereleaseprofile (-DdeployArtifacts=true), which points<sourcepath>at it so the lombok-generated builders, getters andequals/hashCodeappear in the javadoc jar. There is no<reporting>section, and the website build is Docusaurus, so nothing else reads that directory.The execution itself, though, sat in the top-level
<build><plugins>bound togenerate-sources— so it ran on every build, CI and local alike, generating a directory that only a release ever consumes.That matters beyond the wasted work, because it puts
lombok-maven-pluginon the path of every ordinary build. Its last release is 1.18.20.0 (April 2021), the project is dormant, and it cannot delombok on JDK 21+:So today a contributor on a current JDK is blocked by a plugin whose output they will never look at.
Brief change log
lombok-maven-plugin/delombokexecution from<build><plugins>into thereleaseprofile, next to the javadoc plugin that consumes itDeliberately not removing it: lombok is structural to this codebase — 132 of 207 main sources use it, including 37 of 63 in
xtable-api— and 60 main classes have a public surface that is entirely lombok-generated (31@Value, 40@Builder/@SuperBuilder, 22 carrying both, plus 18@Getter/@Data). Dropping delombok would publish a javadoc jar in whichInternalTable,SourceTable,ConversionConfigand friends appear to have nobuilder()and no getters. Delombok genuinely earns its place at release time; it just does not earn it on every build.Verify this pull request
This pull request is a build configuration change, already covered by the existing build.
Verified on Temurin 11 with the project's own wrapper:
./mvnw install -DskipTests./mvnw package -DdeployArtifacts=true -DskipTestsThe second case is the one that matters, since #728 removed this plugin outright and left the javadoc jar empty until #854 restored it. Unpacking
xtable-api-0.5.0-SNAPSHOT-javadoc.jarfrom this build shows the generated API is present and documented:org/apache/xtable/model/InternalTable.InternalTableBuilder.html— the generated builder class has its own pageInternalTable.htmldocumentsbuilder(), the field getters, andequals/hashCodeSo the javadoc is complete, not thinned.
On JDK 21, precisely
This removes one blocker, not all of them. Building
xtable-apion Temurin 21:main— fails atlombok-maven-plugin:delombok-Dspotless.check.skip=true— BUILD SUCCESSThere is also a pre-existing javac-21 inference failure in
xtable-core(cannot infer type-variable(s) T,K,U,TinBaseFileUpdatesExtractor). So this PR does not make the build JDK 21 ready on its own; it removes the first of three independent obstacles.Relationship to #881
#881 adds a
<dependencies>override to this same plugin so that delombok works on newer JDKs. The two are complementary — that override keeps releases working for whoever cuts one on a modern JDK, while this PR means everyday builds do not invoke the plugin at all. Whichever merges second will need a trivial rebase so the override moves with the plugin block; happy to do that.