小编Yus*_*nee的帖子

如何在 mvn 依赖树命令中仅列出直接依赖项?

mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:tree -DoutputFile=/tmp/dependencies.txt -DoutputType=dot -DappendOutput=true
Run Code Online (Sandbox Code Playgroud)

我使用上面的命令来获取依赖项列表,即直接依赖项和传递依赖项。我想要对上述命令进行更改,这将给我一个仅包含直接依赖项的列表,并忽略所有传递依赖项。我不想使用任何其他命令,也不想更改输出文件格式。我们的解析器依赖于输出文件格式。有人对此有任何解决方案吗?

tree dependencies command maven transitive-dependency

5
推荐指数
1
解决办法
2269
查看次数