Find modules that depend on your library.
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.
- Maven
- Node.js 8+
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.dotPROTIP: 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-jsonFinally, start the web application.
npm install # if you have not run before
npm startPROTIP: Use
npm buildand serve static files underbuildfolder 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.
- maven-dependency-plugin
- ant-design for the searchable tree component
- react-debounce-input useful when working with a large data set
- dotparser a dot file parser for node.js
