apache / apache/maven-dependency-plugin

Dependency tree with recursive size

Open
#1,544 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

### New feature, improvement proposal

I often need to get the size of all the jars braught by a given dependency from a project.

I'd like to be able to use `mvn dependency:tree` for that matter.

The output could be something like:

```
[INFO] com.mycompany:myapp:jar:1.0.0-SNAPSHOT
[INFO] +- org.foo:foo-all:jar:2.0:compile (200k, total 1.5m)
[INFO] | +- org.foo:foo-a:jar:2.0:compile (600k)
[INFO] | +- org.foo:foo-b:jar:2.0:compile (700k)
[INFO] +- org.bar:bar:jar:3.1:compile (300k)
```

The total size for "foo-all" is 1.5m = 200k + 600k + 700k.

It could require a specific command line parameter (`show-size` ?), in order to remain retro-compatible.

We could also restrict to selected scopes (for example only `compile` instead of all scopes) using a dedicated command line parameter.

I think this is not supported yet by neither the `dependency` plugin nor the `project-info-reports` plugin.

Can this be achieved? Can you share some implementation pointers?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `mvn dependency:tree` entry point in the dependency plugin and compare it with the project-info-reports plugin, as the issue suggests neither currently supports this. Done should include an opt-in recursive size display and a way to restrict totals to selected scopes while preserving existing output by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.