Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6123

detect self references in POM and fail fast

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.9
    • Fix Version/s: 3.5.2
    • Labels:
    • Environment:
      Oracle JDK 1.8.0_111 on Linux 4.8 x64

      Description

      Maven does not detect self references in a POM and tries to download the artifact it is about to build, which makes no sense and should result in an early error and abort of the build.

      E.g. sample POM:

          <groupId>org.my.acme</groupId>
          <artifactId>my-module</artifactId>
          <version>1.2.3</version>
          <dependencies>
              ...
              <dependency>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>my-module</artifactId>
                  <version>${project.version}</version>
              <dependency>
          <dependencies>
      

      Maven tries to download my-module.jar but obviously fails...

        Issue Links

          Activity

          Hide
          khmarbaise Karl Heinz Marbaise added a comment -

          Currently the following IT's:

          org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit
          org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit
          org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit
          org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit
          

          are failing based on the implemented check.

          Show
          khmarbaise Karl Heinz Marbaise added a comment - Currently the following IT's: org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit org.apache.maven.it.MavenITmng4293RequiresCompilePlusRuntimeScopeTest.testit are failing based on the implemented check.
          Hide
          khmarbaise Karl Heinz Marbaise added a comment -

          The change in the integration test suite fixes the problem with the integration tests.

          Show
          khmarbaise Karl Heinz Marbaise added a comment - The change in the integration test suite fixes the problem with the integration tests.
          Hide
          khmarbaise Karl Heinz Marbaise added a comment -

          Done in Maven Core:8f8c45c990193b04c1770997d446951c5185b164
          Done in Maven Integration Testing 3a1f095ec845c94b8e21ea28e4ffe69a01c29f4b

          Show
          khmarbaise Karl Heinz Marbaise added a comment - Done in Maven Core: 8f8c45c990193b04c1770997d446951c5185b164 Done in Maven Integration Testing 3a1f095ec845c94b8e21ea28e4ffe69a01c29f4b
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-3.x #1660 (See https://builds.apache.org/job/maven-3.x/1660/)
          MNG-6123 detect self references in POM and fail fast o Added unit (khmarbaise: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=8f8c45c990193b04c1770997d446951c5185b164)

          • (edit) maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
          • (add) maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml
          • (edit) maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-3.x #1660 (See https://builds.apache.org/job/maven-3.x/1660/ ) MNG-6123 detect self references in POM and fail fast o Added unit (khmarbaise: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=8f8c45c990193b04c1770997d446951c5185b164 ) (edit) maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java (add) maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml (edit) maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java

            People

            • Assignee:
              khmarbaise Karl Heinz Marbaise
              Reporter:
              grexe Gregor B. Rosenauer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development