apache / apache/maven-dependency-plugin

[MDEP-895] dependency:sources fails for multi-module project

Open
#1,402 3 comments 0 reactions 1 assignee Claimed by @slawekjaranowski View on GitHub
bug priority:critical
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

**[Gerd Aschemann](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ascheman)** opened **[MDEP-895](https://issues.apache.org/jira/browse/MDEP-895?redirect=false)** and commented

When executing `mvn dependency:sources` on a multi-module project it fails to retrieve sources for the modules themselves (which is not necessary as the source code is provided locally already):

```java
mvn dependency:sources
...
[INFO] -----< org.apache.maven.its.dependency:tree-multimodule-module-b >------
[INFO] Building MultimoduleTest Module B 1.0-SNAPSHOT                     [3/3]
[INFO]   from module-b/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for MultimoduleTest 1.0-SNAPSHOT:
[INFO]
[INFO] MultimoduleTest .................................... SUCCESS [  0.390 s]
[INFO] MultimoduleTest Module A ........................... SUCCESS [  0.063 s]
[INFO] MultimoduleTest Module B ........................... FAILURE [  0.005 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.587 s
[INFO] Finished at: 2023-11-09T10:38:16+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project tree-multimodule-module-b: Could not resolve dependencies for project org.apache.maven.its.dependency:tree-multimodule-module-b:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.apache.maven.its.dependency:tree-multimodule-module-a:jar:1.0-SNAPSHOT (absent): Could not find artifact org.apache.maven.its.dependency:tree-multimodule-module-a:jar:1.0-SNAPSHOT -> [Help 1]
```

This is similar to the behaviour of MDEP-409.

A test and PR is already prepared: https://github.com/jmle/maven-dependency-plugin/tree/fix-sources-multimodule

---

**Affects:** 3.6.1

**Issue Links:**
- [MDEP-900](https://issues.apache.org/jira/browse/MDEP-900) dependency:resolve fails for multi-module project
(_**"is cloned by"**_)
- [MDEP-941](https://issues.apache.org/jira/browse/MDEP-941) Deprecate dependency:sources in favor of dependency:resolve-sources
(_**"causes"**_)

**Remote Links:**
- [GitHub Pull Request #349
](https://github.com/apache/maven-dependency-plugin/pull/349)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.