From db11bff65daca66e86358517a3d8bd1973fd76c7 Mon Sep 17 00:00:00 2001 From: DemchaAV Date: Sun, 31 May 2026 13:10:39 +0100 Subject: [PATCH] build: add maven-enforcer-plugin with Java/Maven/plugin-version rules (E2) Wires up Track E2 from the v1.6.5->1.7 readiness taskboard. Binds three rules to the validate phase so the build refuses to start when a precondition is broken: - requireJavaVersion: blocks JDK < 17 (the declared baseline). - requireMavenVersion: blocks Maven < 3.8.0 (oldest version the planned central-publishing pipeline supports). - requirePluginVersions: every plugin must declare an explicit non-LATEST / non-RELEASE / non-SNAPSHOT version. Generalises the PR-7.1 exec-plugin drift lesson. Default-lifecycle plugins (clean, install, site, resources, deploy) are now pinned in a new pluginManagement block so requirePluginVersions has nothing to flag. Versions: clean 3.4.0, install 3.1.4, site 3.21.0, resources 3.3.1, deploy 3.1.4. Minimums and versions live in so they are visible at the top of the file and easy to bump uniformly. Verification: ./mvnw validate -pl . green (Rule 0/1/2 pass), reactor validate green (root + aggregator + children inheriting parent), full suite still green (~50s). --- CHANGELOG.md | 13 ++++++++ pom.xml | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c77f7c..b62e1fe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,19 @@ JitPack continue to resolve through the existing coordinates. excluded by convention (`InternalAnnotationCoverageTest` covers those). Method-level `@since` backfill for the ~380 public methods in these packages is intentionally out of scope here and tracked separately. +- **`maven-enforcer-plugin` gate** (Track E2). Binds three rules to the + `validate` phase so the build refuses to start when a precondition is + broken: `requireJavaVersion` (≥ 17 — the declared baseline, catches + accidental JDK 11 / 15 attempts), `requireMavenVersion` (≥ 3.8.0 — + the oldest version the planned central-publishing pipeline supports), + and `requirePluginVersions` (every plugin must declare an explicit + non-`LATEST` / non-`RELEASE` / non-`SNAPSHOT` version — the + generalisation of the PR-7.1 exec-plugin drift lesson). + Default-lifecycle plugins (`clean` / `install` / `site` / `resources` / + `deploy`) are now pinned in a new `` block so + `requirePluginVersions` has nothing to flag. Minimums and versions + live in `` (`enforcer.requireMavenVersion`, + `enforcer.requireJavaVersion`, `maven.enforcer.plugin.version`). - **Parallel-session stress test** (Track I2). New `DocumentSessionParallelStressTest` drives 32 independent `DocumentSession` instances on a fixed-size thread pool through 4 diff --git a/pom.xml b/pom.xml index 9428937b..ab8da098 100644 --- a/pom.xml +++ b/pom.xml @@ -66,9 +66,14 @@ 3.15.0 + 3.5.0 3.12.0 3.5.5 + + 3.8.0 + 17 + 0.23.1 v1.6.5 @@ -262,6 +267,44 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.4.0 + + + org.apache.maven.plugins + maven-install-plugin + 3.1.4 + + + org.apache.maven.plugins + maven-site-plugin + 3.21.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + + + @@ -297,6 +340,54 @@ + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven.enforcer.plugin.version} + + + enforce-toolchain-and-plugin-versions + validate + + enforce + + + + + [${enforcer.requireMavenVersion},) + GraphCompose requires Maven ${enforcer.requireMavenVersion} or newer. + + + [${enforcer.requireJavaVersion},) + GraphCompose requires JDK ${enforcer.requireJavaVersion} or newer. + + + true + true + true + Every plugin must declare an explicit non-LATEST/RELEASE version. See PR-7.1 (exec-plugin drift) for the lesson. + + + true + + + + + org.apache.maven.plugins