Skip to content

[ISSUE #6602] Enforce Maven and Java build requirements - #7680

Merged
Aias00 merged 2 commits into
apache:masterfrom
yangjj-iso:feat/6602-enforce-build-requirements
Oct 17, 2026
Merged

Aias00 merged 2 commits into
apache:masterfrom
yangjj-iso:feat/6602-enforce-build-requirements

Conversation

@yangjj-iso

@yangjj-iso yangjj-iso commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Builds currently inherit a Maven 3.0.5 minimum from the Apache parent without a repository-owned Java version check. Add Maven Enforcer 3.6.3 to the root build and bind enforce-build-requirements to validate, requiring Maven [3.6.3,) and Java [${java.version},) (17+) in every inheriting module.

This follows the agreed step-1 scope. Dependency-rule rollout and alignment remain in #7679; the verified minimal reproduction is posted there.

Closes #6602.

Validation on wrapper Maven 3.6.3 / JDK 21.0.10:

  • ./mvnw -B -ntp validate: all 213 reactor projects pass, including Checkstyle and inherited version checks.
  • ./mvnw -B -ntp -N apache-rat:check: passes with zero unapproved or unknown licenses.
  • Temporary copies of the POM with an independently raised Maven or Java minimum of 99 both fail with the corresponding Enforcer version error, confirming that version-rule failures block validation.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes. (POM-only change; verified through the Maven lifecycle and temporary negative fixtures above.)
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true. (Full compile/test/install was not run; all 213 modules passed validate.)

CI regression repair

The full CI build exposed an obsolete Apollo proxy-selector deletion assertion after the shared sync contract switched to selector IDs. Update the Apollo deletion fixture and assert the selector ID delivered to the subscriber. The affected seven-module wrapper reactor passes Checkstyle and all 28 selected Apollo/integration/node-sync tests. GitHub CI has been retriggered for this fix.

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

What I verified

  • Plugin version: maven-enforcer-plugin 3.6.3 is the current latest release on Maven Central (confirmed against maven-metadata.xml), so the pin is neither stale nor unreleased.
  • Rules are correct and well coupled: requireMavenVersion [3.6.3,) and requireJavaVersion [${java.version},). Tying the Java floor to the java.version property (17) means the requirement moves automatically when the project bumps its baseline — the right coupling. I also confirmed master's root pom has no enforcer configuration at all, so this is genuinely repository-owned now rather than relying on the Apache parent's loose inherited minimum.
  • Binding is correct for a multi-module build: declaring the plugin (not only pluginManagement) in the root <build> is what makes the validate-phase execution apply to all 213 inheriting modules.
  • Negative validation is the right kind: temporarily raising each minimum to 99 and observing the corresponding failure proves the rules actually bite, which is the part reviewers usually have to take on faith.
  • The bundled Apollo test fix is correct and necessary, not scope creep. On master, AbstractNodeDataSyncService.unCacheProxySelectorData(String) (shenyu-sync-data-api/.../core/AbstractNodeDataSyncService.java:304-314) builds the deleted ProxySelectorData with setPluginName(keys[3]) and setId(keys[4]) and never sets name — and ApolloPathConstants.PROXY_SELECTOR_DATA_ID is "proxy.selector", so the key splits into five parts and [4] is the id. The old assertion checked getName(), which is null. This PR's own first commit proves the pre-existing breakage: pr_build failed with ApolloDataServiceTest.testProxySelectorDataDeleted:283 expected: <test-proxy> but was: <null>. The updated fixture (key ...test-plugin.selector-id, asserting getId()) matches the actual contract, and the second commit is green across the full matrix.

Non-blocking notes

  • enforce now runs in all 213 modules on every build (a few seconds each at validate). That is the safer default for a multi-module reactor; if build time ever becomes a concern, the two version rules could be root-only, but I would not bother.
  • The two unchecked template boxes (test cases, full local install) are acceptable for a POM-only change given the documented lifecycle validation plus the now-green full CI matrix.
  • Optional: surface the new Maven/JDK requirement in the contributor guide so contributors hit a clear local error instead of a CI failure. Not required for merge.

Next step

Ready to merge. Nice catch bundling the Apollo assertion fix — master was red on that test independently of this change.

@Aias00
Aias00 merged commit 7c99d60 into apache:master Oct 17, 2026
51 checks passed
yangjj-iso pushed a commit to yangjj-iso/shenyu that referenced this pull request Oct 18, 2026
Integrate apache#7677 and preserve current master changes. Use the renamed builder in the file parser, assert logging defaults, and adapt the new base-plugin tests. The duplicate Apollo selector test fix was dropped when rebasing onto master, which already contains apache#7680.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] No maven-enforcer-plugin anywhere

2 participants