Skip to content
This repository has been archived by the owner. It is now read-only.
Find modules that depend on your library
TypeScript JavaScript HTML Shell CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
scripts
src
.gitignore
LICENSE
README.md
images.d.ts
package-lock.json
package.json
screenshot.png
tsconfig.json
tsconfig.prod.json
tsconfig.test.json
tslint.json

README.md

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.

You can’t perform that action at this time.