From 4e8773bc444b2bde5fec6e0482e3396647ff88ad Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 1 Jan 2023 19:52:02 +0100 Subject: [PATCH] [MNG-7658] CI-friendly versions should only come from/rely on user properties This closes #945 --- .../DefaultModelVersionProcessor.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java index e44544da53..f341c451c1 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java @@ -44,18 +44,16 @@ public class DefaultModelVersionProcessor implements ModelVersionProcessor { || SHA1_PROPERTY.equals(property); } - // TODO This class MUST test for user properties and THEN for system properties @Override public void overwriteModelProperties(Properties modelProperties, ModelBuildingRequest request) { - if (request.getSystemProperties().containsKey(REVISION_PROPERTY)) { - modelProperties.put(REVISION_PROPERTY, request.getSystemProperties().get(REVISION_PROPERTY)); + if (request.getUserProperties().containsKey(REVISION_PROPERTY)) { + modelProperties.put(REVISION_PROPERTY, request.getUserProperties().get(REVISION_PROPERTY)); } - if (request.getSystemProperties().containsKey(CHANGELIST_PROPERTY)) { - modelProperties.put( - CHANGELIST_PROPERTY, request.getSystemProperties().get(CHANGELIST_PROPERTY)); + if (request.getUserProperties().containsKey(CHANGELIST_PROPERTY)) { + modelProperties.put(CHANGELIST_PROPERTY, request.getUserProperties().get(CHANGELIST_PROPERTY)); } - if (request.getSystemProperties().containsKey(SHA1_PROPERTY)) { - modelProperties.put(SHA1_PROPERTY, request.getSystemProperties().get(SHA1_PROPERTY)); + if (request.getUserProperties().containsKey(SHA1_PROPERTY)) { + modelProperties.put(SHA1_PROPERTY, request.getUserProperties().get(SHA1_PROPERTY)); } } }