I'm looking for a quick way, for any given multi-module project, to show a quick overview of the project hierarchy including only the modules in the project, excluding external dependencies.
eg for a project
project root
+- A
+- B
+- C
+- D
+- E
+- F
+- G
+- H
I would like to see a quick, single screen view for A-H (like it is depicted here) that gives me a fast digestible view to get an idea of a project structure. Ideally it would be command line output, not a platform specific solution (I note there is a tool for VisualStudio).
mvn dependency:tree
is great but too verbose for this case, I suppose I could grep
and cut
the output apart but feels like there should be an easier way (ie another plugin).
A project's dependency tree can be filtered to locate specific dependencies. For example, to find out why Velocity is being used by the Maven Dependency Plugin, we can execute the following in the project's directory: mvn dependency:tree -Dincludes=velocity:velocity.
A tree-based API for resolution of Maven project dependencies. Component entry point is DependencyGraphBuilder . © 2002–2022 The Apache Software Foundation.
A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.
You can filter the dependency tree: http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html
So, if your group ID was com.foo.bar
, you could get the projects in that group ID with:
mvn dependency:tree -Dincludes=com.foo.bar
Assuming all of your project's modules are within that group, that would cover your use case.
You could try this module here: MavenStructurePlugin I had the same problem as you did and found it quite useful.
The output is pretty much what you seem to want:
test
|
|__ a
|
|__ b
|
|
\__ c
|
|__ d
|
|__ e
|
|__ f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With