efegokdemir commented on code in PR #13251:
URL: https://github.com/apache/maven/pull/13251#discussion_r4155652580
##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/Check.java:
##########
@@ -42,6 +42,7 @@ protected boolean shouldSaveModifications() {
@Override
public int execute(UpgradeContext context) throws Exception {
+ context.setDryRun(true);
Review Comment:
The current branch already centralizes context dry-run state in
AbstractUpgradeGoal.execute() with
context.setDryRun(!shouldSaveModifications()), so individual goals cannot omit
the mapping.
##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/Apply.java:
##########
@@ -42,6 +42,7 @@ protected boolean shouldSaveModifications() {
@Override
public int execute(UpgradeContext context) throws Exception {
+ context.setDryRun(false);
Review Comment:
The current head no longer contains the defensive setDryRun(false) call;
dry-run state is initialized centrally in AbstractUpgradeGoal.execute().
##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java:
##########
@@ -277,7 +277,11 @@ public UpgradeResult doApply(UpgradeContext context,
Map<Path, Document> pomMap)
if (hasUpgrades) {
modifiedPoms.add(pomPath);
- context.success("Plugin upgrades applied");
+ if (context.isDryRun()) {
+ context.action("Plugin upgrades would be applied");
+ } else {
+ context.success("Plugin upgrades applied");
Review Comment:
The current head routes inference result messages through
AbstractUpgradeStrategy.logChange(), so mvnup check reports “would be applied”
rather than “applied”.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]