Alex
Alex

Reputation: 9418

auto cleanup maven project dependencies

I inherited a large codebase built with maven multi modules. I want to explicitly reference dependencies used in the source code itself, categorize by compile/test and delete dependencies that are not used at test/runtime.

Is there a tool/plugin that does this for me or do I need to write it myself?

Upvotes: 1

Views: 136

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35795

The dependency plugin offers mvn dependency:analyze which allows you to find out which dependencies are actually used in your source code. It furthermore tells you if you use transitive dependencies directly in your source code.

I do not know whether you can do something like that for test code as well.

Upvotes: 1

Related Questions