Skip to content

Commit

Permalink
[MRELEASE-1153] Revert parts of MRELEASE-1109 (8dfcb47) due to a regr…
Browse files Browse the repository at this point in the history
…ession

This reverts commit 8dfcb47.

This closes #224
  • Loading branch information
michael-o committed Jul 11, 2024
1 parent 985d0bc commit 06f6de4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public abstract class AbstractRewritePomsPhase extends AbstractReleasePhase impl
* Regular expression pattern matching Maven expressions (i.e. references to Maven properties).
* The first group selects the property name the expression refers to.
*/
private static final Pattern EXPRESSION_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
private static final Pattern EXPRESSION_PATTERN = Pattern.compile("\\$\\{(.+)\\}");

/**
* All Maven properties allowed to be referenced in parent versions via expressions
Expand Down Expand Up @@ -462,7 +462,7 @@ private void rewriteVersion(
*/
public static String extractPropertyFromExpression(String expression) {
Matcher matcher = EXPRESSION_PATTERN.matcher(expression);
if (!matcher.find()) {
if (!matcher.matches()) {
return null;
}
return matcher.group(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void setVersion(String version) {
AbstractRewritePomsPhase.extractPropertyFromExpression(versionElement.getTextNormalize());
Properties properties = getProperties();
if (properties != null) {
properties.setProperty(ciFriendlyPropertyName, version);
properties.computeIfPresent(ciFriendlyPropertyName, (k, v) -> version);
}
} else {
JDomUtils.rewriteValue(versionElement, version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</scm>

<properties>
<revision>1.0</revision>
<revision>1.0-SNAPSHOT</revision>
</properties>

<modules>
Expand Down

0 comments on commit 06f6de4

Please sign in to comment.