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 2021/05/30 15:12:44 UTC

[maven] 01/01: [MNG-7166] Remove Maven 2.x compat code

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

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

commit 86fa552456943440125b617bb8a2fc09f3bbdb9a
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun May 30 17:12:27 2021 +0200

    [MNG-7166] Remove Maven 2.x compat code
---
 .../model/normalization/DefaultModelNormalizer.java  | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java b/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java
index 9f86c09..0e3cc22 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java
@@ -75,26 +75,6 @@ public class DefaultModelNormalizer
                 build.setPlugins( new ArrayList<>( normalized.values() ) );
             }
         }
-
-        /*
-         * NOTE: This is primarily to keep backward-compat with Maven 2.x which did not validate that dependencies are
-         * unique within a single POM. Upon multiple declarations, 2.x just kept the last one but retained the order of
-         * the first occurrence. So when we're in lenient/compat mode, we have to deal with such broken POMs and mimic
-         * the way 2.x works. When we're in strict mode, the removal of duplicates just saves other merging steps from
-         * aftereffects and bogus error messages.
-         */
-        List<Dependency> dependencies = model.getDependencies();
-        Map<String, Dependency> normalized = new LinkedHashMap<>( dependencies.size() * 2 );
-
-        for ( Dependency dependency : dependencies )
-        {
-            normalized.put( dependency.getManagementKey(), dependency );
-        }
-
-        if ( dependencies.size() != normalized.size() )
-        {
-            model.setDependencies( new ArrayList<>( normalized.values() ) );
-        }
     }
 
     /**