GeezerVison is showing github.com — Drop plexus-build-api from the Maven plugin and ship m2e lifecycle mapping by slachiewicz · Pull Request #641 · codehaus-plexus/modello
Conversation
slachiewicz
commented
Nov 14, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Finishes what #640 started for modello-core: the Maven plugin drops plexus-build-api too, and ships META-INF/m2e/lifecycle-mapping-metadata.xml (execute on configuration and incremental builds) for the 22 generator goals. The plugin used the API only for the incremental hasDelta skip and error markers on the .mdo; plexus-build-api 1.4.0 is also built against maven-core 3.10.0, whose models modello generates.
In m2e this is an improvement: the hasDelta early return meant the mojo never reached addCompileSourceRoot during m2e's configuration build, so the generated root was never registered. m2e refreshes the project after each build itself, and a failing goal still gets a marker, on pom.xml rather than on the .mdo. The m2e behaviour is read from m2e-core sources, not run in Eclipse.
Breaking for code that constructs the mojos: their constructors no longer take a BuildContext.
Verified: mvn -B -ntp install -Prun-its → all unit tests and 9 ITs pass; the CLI generates Java with no plexus-build-api on the class path.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
slachiewicz
changed the title
Drop plexus-build-api and ship m2e lifecycle mapping
Drop plexus-build-api from the Maven plugin and ship m2e lifecycle mapping
Nov 14, 2026
|
I like where this is going, getting rid of plexus-build-api in the plugin too is the logical next step.
One thing I am not sure about: with runOnIncremental=true and the hasDelta check gone, m2e will reparse and regenerate every model on each incremental build, even when nothing in the .mdo changed. CachingWriter keeps the files untouched so there is no refresh loop, but for something as big as the Maven models it could be noticeable on every save. Maybe a cheap timestamp check against the output would be enough? Or we just accept it. I don't have a clear opinion. On the command line it changes nothing since DefaultBuildContext.hasDelta was always true there anyway.
Losing the markers on the .mdo is IMHO not a bit deal. They were always pinned to line 1 column 1. I don't use Eclipse, so I cannot really test :(
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Measured it: regenerating Maven 3's maven.mdo (3,326 lines) with java, xpp3-reader and xpp3-writer, 48 files, takes 16–36 ms per run in a warm JVM after an 88 ms first run, and CachingWriter leaves unchanged files untouched. That seems cheap enough to accept rather than add a stamp-file check, which would also need to hash the goal's configuration to avoid stale output.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Measured it: regenerating Maven 3's maven.mdo (3,326 lines) with java, xpp3-reader and xpp3-writer, 48 files, takes 16–36 ms per run in a warm JVM after an 88 ms first run, and CachingWriter leaves unchanged files untouched. That seems cheap enough to accept rather than add a stamp-file check, which would also need to hash the goal's configuration to avoid stale output.
Yeah, makes sense and simplifies things.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
fridrich
fridrich approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
removed
Pull requests that remove features
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|