开发者

Create a maven project module tree?

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开发者_如何学C
   +- 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).


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜