Skip to content

Commit

Permalink
Only bump Maven plugin version property when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Sep 23, 2024
1 parent 4881ffd commit 61380e0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 61380e0

Please sign in to comment.