Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

hisener/mvn-dependents

Repository files navigation

Maven Dependents

Find modules that depend on your library.

Motivation

It is painful to make a change on an internal library since anticipating the impact of the change is not that easy always. So, having a list of dependent modules/services might be useful.

Prerequisites

  • Maven
  • Node.js 8+

Usage

Firstly, generate a dot file formatted dependency tree using Maven Dependency Plugin. Setting appendOutput parameter to true is critical if you have multiple repositories.

For instance, you can use the following command to find dependencies with org.springframework groupIds:

mvn dependency:tree -Dincludes="org.springframework:*" \
    -DoutputType=dot \
    -DappendOutput=true \
    -DoutputFile=/tmp/mvn-dependents-workspace/output.dot

PROTIP: Refer dependency:tree documentation.

PROTIP: You can change and use create-dot-file.sh if you have multiple repositories.

Fill the whitelist.json file with your artifacts under scripts/ folder to eliminate unnecessary dependencies. In our case, let's add only spring-core and spring-context because we do not care about other modules.

[
  "spring-core",
  "spring-context"
]

Then, transform the dot file to a json file that can be rendered by user interface using the following node script:

npm install # if you have not run before
node scripts/transfrom-dot-file-to-json

Finally, start the web application.

npm install # if you have not run before
npm start

PROTIP: Use npm build and serve static files under build folder using something like http-server.

Then, open http://localhost:3000/ to see dependents.

PROTIP: See update-data.sh to create an all-in-one script.

Screenshot

Credits

License

MIT. Copyright (C) Halil İbrahim Şener.

About

Find modules that depend on your library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published