You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/06 22:07:11 UTC

(maven-dependency-plugin) branch master updated: [MDEP-900] Document that dependency:resolve needs the reactor modules built

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 426c8344 [MDEP-900] Document that dependency:resolve needs the reactor modules built
426c8344 is described below

commit 426c8344c2756dd1566e4c31980fd5fc71472233
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Oct 6 23:59:09 2026 +0200

    [MDEP-900] Document that dependency:resolve needs the reactor modules built
---
 .../plugins/dependency/resolvers/ResolveDependenciesMojo.java      | 7 +++++++
 src/site/markdown/usage.md.vm                                      | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java
index 9a59c73b..681f7f4e 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java
@@ -56,6 +56,13 @@ import org.sonatype.plexus.build.incremental.BuildContext;
 /**
  * Goal that resolves the project dependencies from the repository. When running on Java 9, the
  * module names will be visible as well.
+ * <p>
+ * Maven resolves the dependencies before the goal runs, so in a multi-module project that has not been
+ * built yet, a dependency on another module of the same build fails. Run a phase that packages the modules
+ * in the same build, for example {@code mvn package dependency:resolve}, or use
+ * <a href="collect-mojo.html">dependency:collect</a>, which needs only the POM files. The {@code exclude*}
+ * and {@code include*} parameters filter what the goal displays; they do not stop Maven from resolving
+ * those dependencies.
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  * @since 2.0
diff --git a/src/site/markdown/usage.md.vm b/src/site/markdown/usage.md.vm
index 41121e97..5422a252 100644
--- a/src/site/markdown/usage.md.vm
+++ b/src/site/markdown/usage.md.vm
@@ -348,6 +348,8 @@ Resolve is intended to be used from the command line like: `mvn dependency:resol
 
 This goal resolves all test and compile scoped dependencies and then displays the resolved versions. This ensures all dependencies are downloaded to the local repository. This is useful when troubleshooting or during intermittent remote repository failures when repeatedly building multiproject modules is undesirable and the build is failing on dependency resolution. It can also be used to quickly determine how versions are being resolved.
 
+Maven resolves the dependencies before the goal runs, so every dependency must be available as a file. In a multi-module project that has not been built yet, a module that depends on another module of the same build fails. Either run a phase that packages the modules in the same build, such as `mvn package dependency:resolve`, or use `dependency:collect`, which needs only the POM files. The `exclude*` and `include*` parameters filter what the goal displays; they do not stop Maven from re [...]
+
 Artifacts can also be resolved by specifying the classifier and optionally type. Type is only used with the classifier and defaults to java-sources. When the classifier is set, the list of dependencies is used as the base to resolve artifacts with the classifier and type. For example: `mvn dependency:resolve -Dclassifier=test-jar` will try to find the test-jar for all dependencies resolve them to the local repository.
 
 `dependency:resolve-sources`