Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-592

Regression: -Dmdep.addParentPoms=true causes <repositories> to be ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0, 3.0.1, 3.0.2
    • None
    • copy-dependencies
    • None
    • Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
      Java version: 1.8.0_111, vendor: Oracle Corporation

    Description

      This works with version 2.10, but fails with 3.0.2.

      Taken the following pom.xml of a small, standalone project:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>org.example</groupId>
          <artifactId>test</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <repositories>
              <repository>
                  <id>spring-milestones</id>
                  <name>Spring Milestones</name>
                  <url>https://repo.spring.io/libs-milestone</url>
                  <snapshots>
                      <enabled>false</enabled>
                  </snapshots>
              </repository>
          </repositories>
          <dependencies>
              <dependency>
                  <groupId>org.springframework.shell</groupId>
                  <artifactId>spring-shell-starter</artifactId>
                  <version>2.0.0.M2</version>
              </dependency>
          </dependencies>
      </project>
      

      The following command fails:

      > mvn clean org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy-dependencies -Dmdep.addParentPoms=true
      …
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy-dependencies (default-cli) on project test: Error resolving project artifact: Failure to find org.springframework.shell:spring-shell-starter:pom:2.0.0.M2 in http://uk.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of uk.maven.org has elapsed or updates are forced for project org.springframework.shell:spring-shell-starter:jar:2.0.0.M2 -> [Help 1]
      

      Dropping the -Dmdep.addParentPoms=true causes the resolution failure to disappear, with spring-shell-starter-2.0.0.M2.jar downloading just fine:

      [INFO] ------------------------------------------------------------------------
      [INFO] Building test 0.0.1-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      Downloading from spring-milestones: https://repo.spring.io/libs-milestone/org/springframework/shell/spring-shell-starter/2.0.0.M2/spring-shell-starter-2.0.0.M2.pom
      Downloaded from spring-milestones: https://repo.spring.io/libs-milestone/org/springframework/shell/spring-shell-starter/2.0.0.M2/spring-shell-starter-2.0.0.M2.pom (1.4 kB at 1.2 kB/s)
      Downloading from spring-milestones: https://repo.spring.io/libs-milestone/org/springframework/shell/spring-shell-parent/2.0.0.M2/spring-shell-parent-2.0.0.M2.pom
      Downloaded from spring-milestones: https://repo.spring.io/libs-milestone/org/springframework/shell/spring-shell-parent/2.0.0.M2/spring-shell-parent-2.0.0.M2.pom (7.4 kB at 22 kB/s)
      Downloading from spring-milestones: https://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter-parent/1.3.0.RELEASE/spring-boot-starter-parent-1.3.0.RELEASE.pom
      …
      

      But of course, this doesn’t download the parent POMs.

      Using version 2.10 works, however.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sewe Andreas Sewe
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: