You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/01/12 14:36:13 UTC

[maven] branch MNG-6846 created (now ec8c65a)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MNG-6846
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at ec8c65a  [MNG-6846] conditional overwrite version

This branch includes the following new commits:

     new ec8c65a  [MNG-6846] conditional overwrite version

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-6846] conditional overwrite version

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-6846
in repository https://gitbox.apache.org/repos/asf/maven.git

commit ec8c65a2e6005f79049619056f9b4c68a48db44f
Author: zhaoyunxing92 <23...@qq.com>
AuthorDate: Fri Jan 10 20:54:21 2020 +0800

    [MNG-6846] conditional overwrite version
---
 .../model/interpolation/AbstractStringBasedModelInterpolator.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
index 388671d..c6f5755 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
@@ -163,15 +163,16 @@ public abstract class AbstractStringBasedModelInterpolator
 
         // Overwrite existing values in model properties. Otherwise it's not possible
         // to define the version via command line: mvn -Drevision=6.5.7 ...
-        if ( config.getSystemProperties().containsKey( REVISION_PROPERTY ) )
+        // I think this overwrite is conditional and only overwrite current projects
+        if ( config.getSystemProperties().containsKey( REVISION_PROPERTY ) && projectDir!=null )
         {
             modelProperties.put( REVISION_PROPERTY, config.getSystemProperties().get( REVISION_PROPERTY ) );
         }
-        if ( config.getSystemProperties().containsKey( CHANGELIST_PROPERTY ) )
+        if ( config.getSystemProperties().containsKey( CHANGELIST_PROPERTY ) && projectDir!=null )
         {
             modelProperties.put( CHANGELIST_PROPERTY, config.getSystemProperties().get( CHANGELIST_PROPERTY ) );
         }
-        if ( config.getSystemProperties().containsKey( SHA1_PROPERTY ) )
+        if ( config.getSystemProperties().containsKey( SHA1_PROPERTY ) && projectDir!=null )
         {
             modelProperties.put( SHA1_PROPERTY, config.getSystemProperties().get( SHA1_PROPERTY ) );
         }