You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/02/22 22:19:07 UTC

(maven-enforcer) branch comment created (now 2081034)

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

elharo pushed a change to branch comment
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


      at 2081034  Remove commented code

This branch includes the following new commits:

     new 2081034  Remove commented code

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-enforcer) 01/01: Remove commented code

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

elharo pushed a commit to branch comment
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git

commit 208103434e1d9476967c2562071a190a3f0c0644
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sat Feb 22 17:18:57 2025 -0500

    Remove commented code
---
 .../rules/BanDuplicatePomDependencyVersions.java   | 24 ++--------------------
 .../rules/dependency/RequireReleaseDepsTest.java   |  7 -------
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDuplicatePomDependencyVersions.java b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDuplicatePomDependencyVersions.java
index e58bf82..42db481 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDuplicatePomDependencyVersions.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDuplicatePomDependencyVersions.java
@@ -62,32 +62,12 @@ public final class BanDuplicatePomDependencyVersions extends AbstractStandardEnf
         // re-read model, because M3 uses optimized model
         MavenXpp3Reader modelReader = new MavenXpp3Reader();
 
-        Model model;
         try (FileInputStream pomInputStream = new FileInputStream(project.getFile())) {
-            model = modelReader.read(pomInputStream, false);
+            Model model = modelReader.read(pomInputStream, false);
+            maven2Validation(model);
         } catch (IOException | XmlPullParserException e) {
             throw new EnforcerRuleError("Unable to retrieve the MavenProject: ", e);
         }
-
-        // @todo reuse ModelValidator when possible
-
-        // Object modelValidator = null;
-        // try
-        // {
-        // modelValidator = helper.getComponent( "org.apache.maven.model.validation.ModelValidator" );
-        // }
-        // catch ( ComponentLookupException e1 )
-        // {
-        // // noop
-        // }
-
-        // if( modelValidator == null )
-        // {
-        maven2Validation(model);
-        // }
-        // else
-        // {
-        // }
     }
 
     private void maven2Validation(Model model) throws EnforcerRuleException {
diff --git a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/dependency/RequireReleaseDepsTest.java b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/dependency/RequireReleaseDepsTest.java
index 3e69749..38785fd 100644
--- a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/dependency/RequireReleaseDepsTest.java
+++ b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/dependency/RequireReleaseDepsTest.java
@@ -26,7 +26,6 @@ import org.apache.maven.enforcer.rules.utils.DependencyNodeBuilder;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.testing.ArtifactStubFactory;
 import org.apache.maven.project.MavenProject;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.InjectMocks;
@@ -62,12 +61,6 @@ class RequireReleaseDepsTest {
     @InjectMocks
     private RequireReleaseDeps rule;
 
-    @BeforeEach
-    void setUp() {
-        // ruleHelper = EnforcerTestUtils.getHelper(project);
-        // rule = new RequireReleaseDeps();
-    }
-
     @Test
     void testSearchNonTransitive() throws IOException {
         when(session.getCurrentProject()).thenReturn(project);