diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java index ed49acf1cb2..3da649d8937 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java @@ -182,8 +182,10 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { if (versionTag.isPresent()) { String version = versionTag.get().getValue().orElse(null); if (version != null) { - if (version.trim().startsWith("${") && !newVersion.equals(getResolutionResult().getPom().getValue(version.trim()))) { - doAfterVisit(new ChangePropertyValue(version, newVersion, false, false).getVisitor()); + if (version.trim().startsWith("${")) { + if (!newVersion.equals(getResolutionResult().getPom().getValue(version.trim()))) { + doAfterVisit(new ChangePropertyValue(version, newVersion, false, false).getVisitor()); + } } else if (!newVersion.equals(version)) { doAfterVisit(new ChangeTagValueVisitor<>(versionTag.get(), newVersion)); }