Align build configuration with the ASF parent POM conventions - #439
Open
slachiewicz wants to merge 2 commits into
Open
Align build configuration with the ASF parent POM conventions#439slachiewicz wants to merge 2 commits into
slachiewicz wants to merge 2 commits into
Conversation
Eight changes, all taken from org.apache:apache:39 and org.apache.maven:maven-parent:49. No behavioural change to any child build: verified against plexus-utils' effective POM and a full spotless/enforcer run. - Pin the palantir-java-format version used by spotless. With a bare <palantirJavaFormat/> spotless picks a version based on the JDK running the build, so `apply` on one JDK and `check` on another can disagree. 2.80.0 is what spotless 3.9.0 already resolves on JDK 21 and 26, so this is a no-op today and stays one from now on. - Drop the checkstyle <headerLocation>. It pointed at raw.githubusercontent.com under the plexus-11 tag, i.e. every build that ran checkstyle fetched it over the network. It was also dead: checkstyle has no executions anywhere, and the JDK 17+ profile already switched configLocation to maven_checks_nocodestyle.xml, which has no RegexpHeader module. Make nocodestyle the default - code style is owned by spotless/palantir - and drop the now redundant checkstyle override and checkstyle.spotless.config property from the java17+ profile. - Let enforceBytecodeVersion ignore test scope, as maven-parent does. Test-only dependencies routinely ship newer bytecode than the target of the artifact we publish and never reach a consumer. - Split the single enforce-maven-and-java-bytecode execution into enforce-maven-version, enforce-java-version and enforce-bytecode-version, so a child can relax one check without losing the other two. No child referenced the old execution id. - Configure maven-project-info-reports-plugin with externalAvatarImages=false, so published team pages stop fetching avatars from a third party, and exclude m2e:lifecycle-mapping from the plugin-management report. - Name every managed version version.<artifactId> as org.apache:apache does, and give every managed plugin a version property. Previously most versions were inline literals that a child could not override at all, and the few properties that existed used three different naming styles. plexus-archiver and plexus-compiler set sisuMavenPluginVersion; both resolve to 1.1.0, which is the value the parent manages, so their now-inert overrides change nothing and can be dropped in a follow-up. - Add <ciManagement>. The ci-management report is enabled in <reporting> but had no data, so every published site carried an empty page. - Add project.reporting.outputEncoding. Generated-by: Claude Opus 5 (1M context)
minimalMavenBuildVersion goes from 3.6.3 to 3.9.0, so the enforce-maven-version rule now demands 3.9.0 for every build, not only for releases. This is build-side only. plexus is a POM parent, it declares no <prerequisites>, and requireMavenVersion is checked when a project is built, never when its artifacts are consumed - so the minimum Maven for anyone depending on a plexus component is unchanged. What changes is that a contributor on Maven 3.6.x can no longer build. The plexus-release profile already forced 3.9.0, so releases were built with 3.9.0 while everything else was allowed to build with 3.6.3. That override is now redundant and is removed; the two paths agree. Generated-by: Claude Opus 5 (1M context)
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.
Nine changes, eight of them taken as inspiration from
org.apache:apache:39andorg.apache.maven:maven-parent:49, in support of the goal of keeping per-project POMs small by letting the parent own more. plexus keeps its own parent - this borrows conventions, it does not inherit from the ASF POM.The first eight change no behaviour for any child build. The ninth raises the Maven version required to build; see below.
What changed
<palantirJavaFormat>to 2.80.0<palantirJavaFormat/>, spotless picks a formatter version based on the JDK running the build, soapplyon one JDK andcheckon another can disagree. maven-parent pins it for exactly this reason. 2.80.0 is what spotless 3.9.0 already resolves on JDK 21 and 26, so this is a no-op today and stays one.<headerLocation>raw.githubusercontent.comunder theplexus-11tag, i.e. a network fetch on every build that ran checkstyle.configLocationnow defaults tomaven_checks_nocodestyle.xml, which is what every JDK 17+ build already used and which has noRegexpHeadermodule. The now-redundant checkstyle override andcheckstyle.spotless.configproperty are removed from thejava17+profile.enforceBytecodeVersionignorestestscopeenforce-maven-version,enforce-java-version,enforce-bytecode-version, as inorg.apache:apache. A child can now relax one check without losing the other two. No child referenced the oldenforce-maven-and-java-bytecodeid.externalAvatarImages=falseteam.htmlpages currently fetch avatars from a third party. Also excludesorg.eclipse.m2e:lifecycle-mappingfrom the plugin-management report.version.<artifactId>for every managed versionspotless-maven-plugin.version,mavenSurefireVersion,njord.version). Now uniform, and every managed plugin has a property.<ciManagement>ci-managementreport is enabled in<reporting>but had no data, so every published site carried an empty page.project.reporting.outputEncodingorg.apache:apache.minimalMavenBuildVersion3.6.3 → 3.9.0. Theplexus-releaseprofile already forced 3.9.0, so releases were built with 3.9.0 while everything else was allowed to build with 3.6.3; that redundant override is removed and the two paths now agree.Verification
Resolved a real child against the new parent:
plexus-utils' POM repointed at27-SNAPSHOTin a scratch directory with its sources symlinked read-only.spotless:checkover plexus-utils' 105 Java files passes with the pin in place, resolving palantir 2.80.0 — zero reformatting.ignoredScope=test, a singlemaven_checks_nocodestyle.xml, the project-info-reports config, and noraw.githubusercontentreference.mvn validateon the child runs all three enforcer executions independently; all pass.spotless:applythenspotless:checkclean on this POM.The Maven 3.9.0 requirement is build-side only
plexusis a POM parent, declares no<prerequisites>, andrequireMavenVersionis checked when a project is built, never when its artifacts are consumed. The minimum Maven for anyone depending on a plexus component is therefore unchanged. What changes is that a contributor still on Maven 3.6.x can no longer build.Two notes for reviewers
No license-header enforcement is happening in plexus today, and this PR does not add it. The
headerLocationremoved here was doubly dead: checkstyle has no executions in this POM or in any of the 16 child repos, and the JDK 17+ profile already redirectedconfigLocationto thenocodestyleconfig, which has no header module. Adding a spotless<licenseHeader>— the way maven-parent does — would be the natural follow-up, but the Java sources currently carry at least three header variants (Copyright 2007 The Codehaus Foundation.with per-file years in plexus-io,Copyright The Codehaus Foundationin most of plexus-utils, one ASF-style), so switching it on would rewrite hundreds of files and erase per-file copyright years. That wants a normalisation decision first.src/main/resources/config/plexus-header.txtis now unreferenced; I left it in place rather than delete the record of the canonical header text.Two inert overrides are left behind.
plexus-archiverandplexus-compilersetsisuMavenPluginVersion; both resolve to1.1.0, which is exactly the value this POM manages. The rename therefore changes no version anywhere — their overrides simply become no-ops and can be dropped in a follow-up child sweep.Refs the wider cleanup discussed in #333.
Drafted with Claude — please verify