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 — [Backport maven-4.0.x] Fix #12931: do not rewrite unmodified POMs in mvnup apply by gnodet · Pull Request #12972 · apache/maven

Conversation

@gnodet

@gnodet gnodet commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Backport of #12938 to maven-4.0.x.

Summary

mvnup apply always logged Saving modified POMs... and wrote every discovered POM, even when every strategy reported 0 POM(s) modified. That both misleads the user and rewrites files that did not change.

UpgradeResult already tracks modifiedPoms. Apply now:

  • writes only those POMs
  • skips the save report entirely when the set is empty

Fixes #12931

Sorry, something went wrong.

Uh oh!

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

All reactions
@kalayciburak @gnodet
Fix #12931: do not rewrite unmodified POMs in mvnup apply (#12938)
b7a7103
* Fix #12931: do not rewrite unmodified POMs in mvnup apply

mvnup apply always logged "Saving modified POMs..." and wrote every
discovered POM, even when no strategy reported changes. Save only the
POMs in UpgradeResult.modifiedPoms and skip the save report when that
set is empty.

* Don't call saveModifications when no POM was modified

Skip the save path in execute when modifiedPoms is empty, instead of
returning early inside saveModifications.
@gnodet gnodet added this to the 4.0.0 milestone Aug 31, 2026
@gnodet gnodet added the bug Something isn't working label Aug 31, 2026
@gnodet gnodet modified the milestones: 4.0.0, 4.0.0-rc-7 Aug 31, 2026
@gnodet
gnodet merged commit d17092e into maven-4.0.x Aug 31, 2026
24 checks passed

Uh oh!

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

@gnodet
gnodet deleted the backport/12938-to-maven-4.0.x branch August 31, 2026 08:30
gnodet
gnodet commented Aug 31, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

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.

✅ Looks Good

Clean backport of #12938 (merged to master) to maven-4.0.x. The diff is byte-for-byte identical to the original.

Technical notes:

  • The change from returning int to UpgradeResult in doUpgrade correctly exposes modifiedPoms() to the caller without breaking Apply or Check subclasses.
  • The exception-handling path constructs UpgradeResult.failure() with empty modifiedPoms, preventing saveModifications from being called on failure — correct behavior.
  • Tests use FileTime comparison to verify unmodified POMs are not rewritten (not just that the method isn't called) — robust assertion strategy.
  • No backport to 3.x branches needed — mvnup is a Maven 4 feature.

🤖 This review was generated by ForgeBot.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot assigned gnodet Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

@gnodet gnodet

Labels

bug Something isn't working

Projects

None yet

Milestone

4.0.0-rc-7

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@gnodet @kalayciburak
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.