This tool generates the list of dependencies of your project.
The following technologies have been used to write the tool
- Gradle
- Kotlin
- Klaxon
- YAML Azure Pipelines
- Spring Boot (without Web)
- Digraph parser
The tool currently supports: Input file formats:
- npm
- maven Output file formats:
- markdown - the list of dependencies is written to a table in markdown format
Maven Dependency plugin is used to generate the dependency tree in the DOT format. This is easy to parse with a third party java library.
The dependencies are collected using the npm ls command.
Generate the DOT file of your project:
- navigate to the folder containing POM file
- run the maven command:
mvn clean test-compile dependency:resolve dependency:tree -Dmaven.main.skip=true -Dmaven.test.skip=true -DoutputFile=maven.dg -DoutputType=dot -DappendOutput=false
- navigate to the folder containing package.json file
- run the following commands:
- to get production dependencies:
npm ls --json --parseable --depth=0 --prod=true > npm.json
- to get development dependencies:
npm ls --json --parseable --depth=0 --dev=true > npm-dev.json
In case you want to include nested dependencies in the list,
omit --depth=0
argument from npm ls
command
Example:
{
"output": {
"file": "output.md",
"type": "markdown"
},
"toProcess": [
{
"group": "FE",
"files": [
{
"path": "npm.json",
"type": "npm"
}
],
"filter": {
"exclude": [
"package-name-to-exclude"
]
}
},
{
"group": "BE",
"files": [
{
"path": "maven.dg",
"type": "maven",
"settings": {
"scope": "compile"
}
}
],
"filter": {
"exclude": [
"com.vladonemo:another"
]
}
},
{
"group": "FE test",
"files": [
{
"path": "npm-test.json",
"type": "npm"
}
]
},
{
"group": "BE test",
"files": [
{
"path": "maven.dg",
"type": "maven",
"settings": {
"scope": "test"
}
}
]
}
]
}
E.g. using gradle:
gradlew bootRun --args="./input.json"