Enable consumer POM flattening for Maven 4 RC-6 readiness#2647
Open
ascheman wants to merge 1 commit into
Open
Conversation
Since apache/maven#11780 (first shipping with 4.0.0-rc-6), installing or deploying a POM-packaged project whose model cannot be downgraded to 4.0.0 fails fast. The PLC4X parent uses 4.1.0-only features (subprojects, build sources), so every 'mvn install' will break on RC-6 without maven.consumer.pom.flatten=true. With flattening enabled, jar module consumer POMs become self-contained model-4.0.0 (no parent reference), which also fixes Maven 3/Gradle consumption of published artifacts (apache/maven#11772). Verified with 4.0.0-rc-5 (current wrapper pin) and a current 4.0.0-SNAPSHOT: full reactor builds green with both. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Heads-up: PLC4X will stop building with Maven 4.0.0-RC-6
Since apache/maven#11780 (backported to 4.0.x via #12236, so first shipping with RC-6),
install/deployof a POM-packaged project fails fast when its consumer POM cannot be downgraded to model 4.0.0. The PLC4X parent uses 4.1.0-only features (<subprojects>, build<sources>), so with a current4.0.0-SNAPSHOT(pre-RC-6) every build dies in the very first reactor module:Fix
One line in
.mvn/maven.config:-Dmaven.consumer.pom.flatten=true.Side benefit beyond staying buildable: with flattening enabled, the jar module consumer POMs become self-contained model-4.0.0 (no
<parent>reference), which fixes Maven 3/Gradle consumption of published PLC4X artifacts — the very issue behind apache/maven#11772 (rc-5 silently publishes model-4.1.0 parent POMs that Maven 3/Gradle cannot parse).Verified locally
4.0.0-rc-5(current wrapper pin): full reactorBUILD SUCCESS— property exists and is safe on rc-54.0.0-SNAPSHOT(pre-RC-6): full reactor (113 modules)BUILD SUCCESS; without this change: fail-fast as aboveFound while testing PLC4X against pre-RC-6 Maven for the Maven 4 adoption effort — happy to keep sending such findings your way if useful. 🙏
🤖 Generated with Claude Code