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

dependency:go-offline does not use repositories from parent pom in reactor build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.2
    • 3.1.3
    • go-offline
    • None

    Description

      Observed behaviour

      When running dependency:go-offline on multi-module projects, sub-modules always resolve their dependencies from maven-central, even if they inherit <repositories> from their parent pom

      Expected behaviour

      dependency:go-offline resolves dependencies exactly the same way as they would be resolved in when running mvn install on the project, respecting <repositories> defined in parent poms.

      Description

      When using dependency:go-offline to resolve the dependencies of a reactor build, repositories defined in a parent pom are ignored when resolving the dependencies of a module.

      I have attached an example project to illustrate the issue

      When running 

      mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline -Dmaven.repo.local=./depPluginRepo
      

      on the parent project, the dependencies of the "parent" module are correctly resolved from the jcenter repository. But the dependencies of "child" are resolved from maven central. Even worse: When the dependency in question is not found in maven central, the build fails.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              theo Andreas Janning
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: