[ https://issues.apache.org/jira/browse/MRELEASE-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17755816#comment-17755816 ]
ASF GitHub Bot commented on MRELEASE-1109: ------------------------------------------ kwin commented on code in PR #198: URL: https://github.com/apache/maven-release/pull/198#discussion_r1298050608 ########## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java: ########## @@ -89,6 +93,18 @@ public abstract class AbstractRewritePomsPhase extends AbstractReleasePhase impl */ private String modelETL = JDomModelETLFactory.NAME; + /** + * 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("\\$\\{(.+)\\}"); + + /** + * All Maven properties allowed to be referenced in parent versions via expressions + * @see <a href="https://maven.apache.org/maven-ci-friendly.html">CI-Friendly Versions</a> + */ + private static final List<String> CI_FRIENDLY_PROPERTIES = Arrays.asList("revision", "sha1", "changelist"); Review Comment: It is available in https://github.com/apache/maven/blob/eff2fbf2a9baaa2178825b5745c7f152330c8946/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java#L38 but it has only been introduced with 3.8.5 (https://issues.apache.org/jira/browse/MNG-7407) so I would stick with the separate copy inside this class. > update-versions removes the CI-friendly ${revisions} > ---------------------------------------------------- > > Key: MRELEASE-1109 > URL: https://issues.apache.org/jira/browse/MRELEASE-1109 > Project: Maven Release Plugin > Issue Type: Bug > Components: prepare, update-versions > Affects Versions: 2.5.3, 3.0.0-M7 > Reporter: Marcel Stör > Assignee: Konrad Windszus > Priority: Major > > Given: a project using CI-friendly versions as per > [https://maven.apache.org/maven-ci-friendly.html] > {code:xml} > <version>${revision}</version> > ... > <properties> > <revision>1.0.0-SNAPSHOT</revision> > </properties> > {code} > If I run {{mvn release:update-versions}} (with or without > {{{}-DautoVersionSubmodules=true{}}}) I expect the release plugin to change > the {{$revision}} property. Instead it blindly replaces > {{<version>${revision}</version>}} with the hard-coded version set on the CLI. -- This message was sent by Atlassian Jira (v8.20.10#820010)