You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/12/20 08:12:08 UTC

[maven] branch MNG-7634_maven-3.9.x updated (474d8c0ab -> 2dbee4340)

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

michaelo pushed a change to branch MNG-7634_maven-3.9.x
in repository https://gitbox.apache.org/repos/asf/maven.git


    omit 474d8c0ab [MNG-7634] Revert MNG-5982 and MNG-7417
     add 4db9b94ba [MNG-7637] Possible NPE in MavenProject#hashCode()
     add a1d43778e [MNG-7636] Partially revert MNG-5868 to restore backward compatibility (see MNG-7316)
     add 46c84876d Directories, not folders
     add a6b8a9e9f [MNG-7578] Fallback on Linux executable in Windows for findTool utility (#861)
     add 4adaf2abc Implement some #toString() methods
     new 2dbee4340 [MNG-7634] Revert MNG-5982 and MNG-7417

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (474d8c0ab)
            \
             N -- N -- N   refs/heads/MNG-7634_maven-3.9.x (2dbee4340)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../org/apache/maven/project/MavenProject.java     |  16 +-
 .../apache/maven/toolchain/java/JavaToolchain.java |   2 +-
 .../maven/toolchain/java/JavaToolchainImpl.java    |  13 +-
 .../java/org/apache/maven/DefaultMavenTest.java    |   7 +
 maven-model/src/main/mdo/maven.mdo                 | 170 +++++++++++++++++++++
 .../java/org/apache/maven/model/BuildTest.java     |   8 +
 .../java/org/apache/maven/model/DeveloperTest.java |  11 ++
 .../apache/maven/model/IssueManagementTest.java    |  10 ++
 .../java/org/apache/maven/model/LicenseTest.java   |  10 ++
 .../org/apache/maven/model/MailingListTest.java    |   9 ++
 .../org/apache/maven/model/OrganizationTest.java   |  28 ++++
 .../test/java/org/apache/maven/model/ScmTest.java  |   9 ++
 12 files changed, 283 insertions(+), 10 deletions(-)


[maven] 01/01: [MNG-7634] Revert MNG-5982 and MNG-7417

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

michaelo pushed a commit to branch MNG-7634_maven-3.9.x
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 2dbee43408d4473dd5cfacff254ab2a592dde9db
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 17 20:48:42 2022 +0100

    [MNG-7634] Revert MNG-5982 and MNG-7417
    
    This closes #917
---
 .../internal/DefaultArtifactDescriptorReader.java        | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
index 356cfa414..8a791f34d 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
@@ -253,8 +253,11 @@ public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader
                 modelRequest.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
                 modelRequest.setProcessPlugins(false);
                 modelRequest.setTwoPhaseBuilding(false);
-                modelRequest.setSystemProperties(toProperties(session.getSystemProperties()));
-                modelRequest.setUserProperties(toProperties(session.getUserProperties()));
+                // This merge is on purpose because otherwise user properties would override model
+                // properties in dependencies the user does not know. See MNG-7563 for details.
+                modelRequest.setSystemProperties(
+                        toProperties(session.getUserProperties(), session.getSystemProperties()));
+                modelRequest.setUserProperties(new Properties());
                 modelRequest.setModelCache(modelCacheFactory.createCache(session));
                 modelRequest.setModelResolver(new DefaultModelResolver(
                         session,
@@ -303,9 +306,14 @@ public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader
         }
     }
 
-    private Properties toProperties(Map<String, String> map) {
+    private Properties toProperties(Map<String, String> dominant, Map<String, String> recessive) {
         Properties props = new Properties();
-        props.putAll(map);
+        if (recessive != null) {
+            props.putAll(recessive);
+        }
+        if (dominant != null) {
+            props.putAll(dominant);
+        }
         return props;
     }