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

dependency:go-offline does not download all dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • go-offline

    Description

      It appears the go-offline goal of the maven dependency plugin downloads only jar but no pom for some of the dependencies, and only pom but no jar for some other dependencies.

      Steps to reproduce

      1. Resolve the pom in attached tar ball

      $ docker run -it --rm -v $(greadlink -f demo):/tmp/demo:ro maven:3.8.4-eclipse-temurin-11-alpine bash
      bash-5.1# mvn -B -f /tmp/demo/pom.xml dependency:go-offline
      

      2. Verify some jars and poms are missing

      there is no pom.xml for maven-core 2.0.6
      bash-5.1# ls ~/.m2/repository/org/apache/maven/maven-core/2.0.6/
      _remote.repositories       maven-core-2.0.6.jar       maven-core-2.0.6.jar.sha1
      
      there is no jar for maven-profile 2.0.6
      bash-5.1# ls ~/.m2/repository/org/apache/maven/maven-profile/2.0.6/
      _remote.repositories          maven-profile-2.0.6.pom       maven-profile-2.0.6.pom.sha1
      

      3. maven test requires more files to be downloaded

      bash-5.1# mvn test                                                                                                                                                           [0/1962]
      [INFO] Scanning for projects...
      [INFO]
      [INFO] --------------------------< org.example:demo >--------------------------
      [INFO] Building demo 1.0-SNAPSHOT
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO]
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ demo ---
      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom
      Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom (6.7 kB at 3.5 kB/s)
      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6.pom
      ........
      

      4. Verify the missing files are downloaded

      bash-5.1# ls ~/.m2/repository/org/apache/maven/maven-profile/2.0.6/
      _remote.repositories          maven-profile-2.0.6.jar       maven-profile-2.0.6.jar.sha1  maven-profile-2.0.6.pom       maven-profile-2.0.6.pom.sha1
      bash-5.1# ls ~/.m2/repository/org/apache/maven/maven-core/2.0.6/
      _remote.repositories       maven-core-2.0.6.jar       maven-core-2.0.6.jar.sha1  maven-core-2.0.6.pom       maven-core-2.0.6.pom.sha1
      

      Attachments

        1. demo.tar.gz
          2 kB
          Wei Lin

        Activity

          People

            sjaranowski Slawomir Jaranowski
            wlnirvana Wei Lin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: