GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Drop plexus-build-api from modello-core by fridrich · Pull Request #640 · codehaus-plexus/modello

Conversation

@fridrich

@fridrich fridrich commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

plexus-build-api 1.4.0 builds against maven-core/maven-model/maven-model-builder 3.10.0 (provided), see https://github.com/codehaus-plexus/plexus-build-api/blob/plexus-build-api-1.4.0/pom.xml. Those Maven models are generated by modello, so modello-core depending on plexus-build-api creates a bootstrap cycle. Its default implementation also needs Maven classes at runtime, so the CLI and ant task would have to ship them.

modello-core only used BuildContext.refresh(File). The mojo now passes it as a Consumer<File> via ModelloParameterConstants.FILE_REFRESHER; generators fall back to a no-op when it is absent (CLI, ant), matching the old DefaultBuildContext behaviour outside an IDE. modello-maven-plugin keeps using plexus-build-api.

Breaking: the protected AbstractModelloGenerator.getBuildContext() is removed; external generators calling it need to switch. @since 2.9.1 on the new constant is a placeholder, adjust to whatever version this lands in.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fridrich fridrich mentioned this pull request Nov 14, 2026
Bump plexus-build-api to 1.4.0 and bind a standalone BuildContext #639
Closed
@slachiewicz

slachiewicz commented Nov 14, 2026

Copy link
Copy Markdown
Member

maybe simply drop refresh functionality? nowdays it's less important

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnodet-bot
gnodet-bot reviewed Nov 14, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Two observations on this otherwise clean change.

1. @SuppressWarnings typo makes the annotation ineffective

initialize() has had @SuppressWarnings("uncheked") (note: misspelled) since before this PR. The annotation is silently ignored by the compiler — "uncheked" is not a known suppression key. This PR adds a new unchecked cast inside initialize() that relies on the annotation to suppress the compiler warning. The fix is a one-character correction.

2. Competing PR #639 addresses the same bootstrap cycle

PR #639 by @slachiewicz ("Bump plexus-build-api to 1.4.0 and bind a standalone BuildContext") is also open and targets the same issue. Its approach bumps build-api to 1.4.0 and registers a StandaloneBuildContext in the CLI and Ant task containers. This PR's approach is lighter-weight (no build-api dep in core at all), but the two are mutually exclusive. Maintainers should decide which direction to take before merging either.

Informational (no action required): XdocGenerator, XsdGenerator, and VelocityGenerator create raw CachingWriter instances rather than going through newWriter(), so they never trigger fileRefresher.accept(). This was already the case before this PR (they never called getBuildContext().refresh() either) — not a regression, just an existing gap worth noting if full IDE incremental build support is ever a goal.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread modello-core/src/main/java/org/codehaus/modello/plugin/AbstractModelloGenerator.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@fridrich
fridrich requested a review from gnodet-bot November 14, 2026 16:20
gnodet-bot
gnodet-bot approved these changes Nov 14, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Following up on my earlier review — both issues have been addressed.

1. @SuppressWarnings typo — ✅ fixed in this commit.

2. Competing PR #639 — ✅ now closed, no longer a concern.

The two new tests cover the refresher contract cleanly: fileRefresherOnlyNotifiedOnChange verifies the CachingWriter gate (refresh fires only when content differs), and fileRefresherOptional confirms the no-op fallback when no refresher is registered.

Pre-fix validation: static trace confirms both tests would fail to compile against the pre-fix code (no FILE_REFRESHER constant, no Consumer injection pathway), so they correctly validate the new behaviour.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fridrich

fridrich commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@slachiewicz I pushed the refresh removal as a separate commit, so you can take it or drop it. It is purely your call :) Either way modello-core will not depend on plexus-build-api.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fridrich added 3 commits November 14, 2026 17:26
@fridrich
Drop plexus-build-api from modello-core
424feb9
plexus-build-api 1.4.0 builds against maven-core/maven-model (provided),
which are generated by modello: bootstrap cycle. Its default impl needs
those Maven classes at runtime, so CLI/ant would have to ship them.

Core only needed BuildContext.refresh(File). Mojo now passes it as a
Consumer<File> via ModelloParameterConstants.FILE_REFRESHER; no-op when
absent (CLI, ant). Removes protected AbstractModelloGenerator.getBuildContext().

javax.inject now declared explicitly; it came transitively via build-api.
@fridrich
Fix @SuppressWarnings("uncheked") typo in AbstractModelloGenerator
774d883
@fridrich
Drop generated-file refresh from generators
855586c
Per review: refresh matters little nowadays. Removes FILE_REFRESHER and
newWriter()'s wrapper; CachingWriter already skips identical content.
Mojo keeps BuildContext for delta checks and messages.

Independent of the build-api removal; drop this commit to keep the
callback.
@fridrich
fridrich force-pushed the master branch from a228d71 to 855586c Compare November 14, 2026 16:27
@fridrich
fridrich requested a review from gnodet-bot November 14, 2026 16:27
@slachiewicz
slachiewicz merged commit 124d346 into codehaus-plexus:master Nov 14, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@slachiewicz slachiewicz added the breaking Pull requests that break existing features label Nov 14, 2026
@slachiewicz slachiewicz mentioned this pull request Nov 14, 2026
Drop plexus-build-api from the Maven plugin and ship m2e lifecycle mapping #641
Merged
@slachiewicz slachiewicz added removed Pull requests that remove features and removed breaking Pull requests that break existing features labels Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnodet-bot gnodet-bot Awaiting requested review from gnodet-bot

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

removed Pull requests that remove features

Projects

None yet

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.

3 participants

@fridrich @slachiewicz @gnodet-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.