GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix #12931: do not rewrite unmodified POMs in mvnup apply by kalayciburak · Pull Request #12938 · apache/maven Conversation
Contributor
Summary
This answers the question on the issue: previously yes, unmodified files were rewritten; they are not anymore. Fixes #12931 Checklist
Test planExecuted: Result: 48 tests, 0 failures (includes new Also executed: Result: 665 tests, 0 failures, 2 skipped.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsmvnup 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.
elharo
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. published signature change. when was this method introduced?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. protected int since 4.0.0-rc-6, mvnup only (not maven-api). nothing overrides it. return is UpgradeResult now so apply can skip unmodified poms. can switch back to int if you want.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to just not call this method if nothing was modified
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done, skip the call when modifiedPoms is empty
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
HDPark95
reviewed
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Measured both trees (maven:3.9-temurin-21): 665 green at ed2b870, and reverting only AbstractUpgradeGoal.java fails exactly the 2 new tests. Worth pinning: AbstractUpgradeStrategy.apply catches a throwing strategy and returns failure(pomMap.keySet(), Set.of()), so errorPoms is empty and success() is true. Probe (strategy edits a/pom.xml, then throws): master rc=0 with the partial edit written, here rc=0 and it is dropped. Dropping is safer, but rc should be 1. The Path.of(".") branch is unreachable: execute() returns 0 on an empty pomMap before doUpgrade. All 665 stay green without it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gnodet
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean, well-scoped fix that correctly threads the existing Observations (informational):
📋 PR Metadata
🔀 Backport Status
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying. Claude Code on behalf of Guillaume Nodet
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsSkip the save path in execute when modifiedPoms is empty, instead of returning early inside saveModifications. Uh oh!
There was an error while loading. Please reload this page.
gnodet
added a commit
that referenced
this pull request
…12972) * 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. Co-authored-by: Burak Kalaycı <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers+1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesLabels
bug
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. mvnup reports saving modified pom's while not change a thingUh 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. | ||||||||||||||||||||||||||||||
| 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. |