File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
maven-release-manager/src
main/java/org/apache/maven/shared/release
test/resources/projects/rewrite-for-release/pom-with-parent-and-cifriendly-expressions Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public abstract class AbstractRewritePomsPhase extends AbstractReleasePhase impl
9696 * Regular expression pattern matching Maven expressions (i.e. references to Maven properties).
9797 * The first group selects the property name the expression refers to.
9898 */
99- private static final Pattern EXPRESSION_PATTERN = Pattern .compile ("\\ $\\ {(.+? )\\ }" );
99+ private static final Pattern EXPRESSION_PATTERN = Pattern .compile ("\\ $\\ {(.+)\\ }" );
100100
101101 /**
102102 * All Maven properties allowed to be referenced in parent versions via expressions
@@ -462,7 +462,7 @@ private void rewriteVersion(
462462 */
463463 public static String extractPropertyFromExpression (String expression ) {
464464 Matcher matcher = EXPRESSION_PATTERN .matcher (expression );
465- if (!matcher .find ()) {
465+ if (!matcher .matches ()) {
466466 return null ;
467467 }
468468 return matcher .group (1 );
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ public void setVersion(String version) {
198198 AbstractRewritePomsPhase .extractPropertyFromExpression (versionElement .getTextNormalize ());
199199 Properties properties = getProperties ();
200200 if (properties != null ) {
201- properties .setProperty (ciFriendlyPropertyName , version );
201+ properties .computeIfPresent (ciFriendlyPropertyName , ( k , v ) -> version );
202202 }
203203 } else {
204204 JDomUtils .rewriteValue (versionElement , version );
Original file line number Diff line number Diff line change 3030 </scm >
3131
3232 <properties >
33- <revision >1.0</revision >
33+ <revision >1.0-SNAPSHOT </revision >
3434 </properties >
3535
3636 <modules >
You can’t perform that action at this time.
0 commit comments