apache / apache/maven-dependency-plugin
[MDEP-764] dependency:analyze-dep-mgt fails for multi module projects
- Dominant language
- Java
- Stars
- 175
- Forks
- 196
- Avg merge
- 19h 30m
- Merged PRs (30d)
- 5
Description
**[Jon Edvardsson](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=snappypig)** opened **[MDEP-764](https://issues.apache.org/jira/browse/MDEP-764?redirect=false)** and commented
dependency:dependency:analyze-dep-mgt fails for multi module projects (that have yet not been installed?). The goal fail with the same error as MDEP-409.
```sh
➜ my-app git:(master) ✗ mvn dependency:analyze-dep-mgt
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: aarch_64
[INFO] os.detected.version: 11.5
[INFO] os.detected.version.major: 11
[INFO] os.detected.version.minor: 5
[INFO] os.detected.classifier: osx-aarch_64
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-app [pom]
[INFO] my-app-api [jar]
[INFO] my-app-impl [jar]
[INFO]
[INFO] ----------------< com.example:my-app >-----------------
[INFO] Building my-app 1.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.2.0:analyze-dep-mgt (default-cli) @ my-app ---
[INFO] Found Resolved Dependency/DependencyManagement mismatches:
[INFO] Ignoring Direct Dependencies.
[INFO] None
[INFO]
[INFO] --------------< com.example:my-app-api >---------------
[INFO] Building my-app-api 1.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.2.0:analyze-dep-mgt (default-cli) @ my-app-api ---
[INFO] Found Resolved Dependency/DependencyManagement mismatches:
[INFO] Ignoring Direct Dependencies.
[INFO] com.google.code.findbugs:jsr305:jar was excluded in DepMgt, but version 3.0.2 has been found in the dependency tree.
[INFO] javax.annotation:javax.annotation-api:jar was excluded in DepMgt, but version 1.3.2 has been found in the dependency tree.
[INFO] com.google.protobuf:protobuf-java:jar was excluded in DepMgt, but version 3.17.3 has been found in the dependency tree.
[WARNING] Potential problems found in Dependency Management
[INFO]
[INFO] -------------< com.example:my-app-impl >-------------
[INFO] Building my-app-impl 1.0-SNAPSHOT [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for my-app 1.0-SNAPSHOT:
[INFO]
[INFO] my-app ....................................... SUCCESS [ 0.332 s]
[INFO] my-app-api ................................... SUCCESS [ 0.090 s]
[INFO] my-app-impl ................................ FAILURE [ 0.166 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.871 s
[INFO] Finished at: 2021-09-08T10:57:57+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-app-impl: Could not resolve dependencies for project com.example:my-app-impl:jar:1.0-SNAPSHOT: Could not find artifact com.example:my-app-api:jar:1.0-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :my-app-impl
➜ my-app git:(master) ✗
```
---
**Affects:** 3.2.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `mvn dependency:analyze-dep-mgt` in the three-module reactor described in the report, then compare the failure with MDEP-409. Trace the `dependency:analyze-dep-mgt` goal while the reactor is not installed; done means the goal handles the inter-module dependency and completes without the resolution error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100