apache / apache/maven-dependency-plugin

[MDEP-916] Maven Dependency Plugin: Inclusion of main artifact in the output report

Open
#1,417 1 comment 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

**[Arnab Banerjee](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=arnabcse28)** opened **[MDEP-916](https://issues.apache.org/jira/browse/MDEP-916?redirect=false)** and commented

While using [Apache Maven Dependency Plugin](https://maven.apache.org/plugins/maven-dependency-plugin/index.html) and using dependency:list, I noticed that the main artifact, which is being analyzed, is NOT getting included in the output report.
It would be great to have an user property for the plugin to include the main artifact as well in the report.
 
Following is an example for dependency listing of _*org.apache.httpcomponents.client5:httpclient5*_
 
[INFO] -----------< org.apache.httpcomponents.client5:httpclient5 >------------
[INFO] Building Apache HttpClient 5.4-alpha3-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:list (default-cli) @ httpclient5 ---
[INFO]
[INFO] The following files have been resolved:
[INFO]    org.apache.httpcomponents.core5:httpcore5:jar:5.3-alpha2:compile -- module org.apache.httpcomponents.core5.httpcore5 [auto]
[INFO]    org.apache.httpcomponents.core5:httpcore5-h2:jar:5.3-alpha2:compile -- module org.apache.httpcomponents.core5.httpcore5.h2 [auto]
[INFO]    org.slf4j:slf4j-api:jar:1.7.36:compile -- module org.slf4j [auto]
[INFO]    org.conscrypt:conscrypt-openjdk-uber:jar:2.5.2:compile (optional) -- module org.conscrypt [auto]
[INFO]    org.apache.httpcomponents.core5:httpcore5-reactive:jar:5.3-alpha2:test -- module org.apache.httpcomponents.core5.httpcore5.reactive [auto]
[INFO]    org.reactivestreams:reactive-streams:jar:1.0.4:test -- module org.reactivestreams [auto]
[INFO]    io.reactivex.rxjava2:rxjava:jar:2.2.21:test -- module io.reactivex.rxjava2 [auto]
[INFO]    org.apache.logging.log4j:log4j-slf4j-impl:jar:2.23.0:test -- module org.apache.logging.log4j.slf4j.impl
[INFO]    org.apache.logging.log4j:log4j-api:jar:2.23.0:test -- module org.apache.logging.log4j
[INFO]    org.apache.logging.log4j:log4j-core:jar:2.23.0:test -- module org.apache.logging.log4j.core
[INFO]    org.brotli:dec:jar:0.1.2:compile (optional) -- module dec (auto)
[INFO]    org.junit.jupiter:junit-jupiter:jar:5.10.2:test -- module org.junit.jupiter
[INFO]    org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test -- module org.junit.jupiter.api
[INFO]    org.opentest4j:opentest4j:jar:1.3.0:test -- module org.opentest4j
[INFO]    org.junit.platform:junit-platform-commons:jar:1.10.2:test -- module org.junit.platform.commons
[INFO]    org.apiguardian:apiguardian-api:jar:1.1.2:test -- module org.apiguardian.api
[INFO]    org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test -- module org.junit.jupiter.params
[INFO]    org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test -- module org.junit.jupiter.engine
[INFO]    org.junit.platform:junit-platform-engine:jar:1.10.2:test -- module org.junit.platform.engine
[INFO]    org.hamcrest:hamcrest:jar:2.2:test -- module org.hamcrest [auto]
[INFO]    org.mockito:mockito-core:jar:4.11.0:test -- module org.mockito [auto]
[INFO]    net.bytebuddy:byte-buddy:jar:1.12.19:test -- module net.bytebuddy
[INFO]    net.bytebuddy:byte-buddy-agent:jar:1.12.19:test -- module net.bytebuddy.agent
[INFO]    org.objenesis:objenesis:jar:3.3:test -- module org.objenesis [auto]
[INFO]
 
Expected behavior: We should be able to include "org.apache.httpcomponents.client5:httpclient5" as well as part of the output for reporting/automation purposes. 
Probably similar to [](https://maven.apache.org/plugins/maven-dependency-plugin/list-mojo.html#includeParents) we can have an option like: "includeSelf"
 
Note: dependency:tree goal gives us complete output.

---

**Affects:** 3.6.1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the dependency:list goal documentation and the existing includeParents option. Define the includeSelf behavior so the analyzed main artifact appears in the dependency:list report when enabled, and verify the output against the example in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.