Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.2
-
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.