We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我尝试了 3 种方法来做到这一点,使用 maven-javadoc-plugin 和 doclet 在 JavaDocs 中生成 UML 图:
1) UmlGraphDoc
2) apiviz
3) yworks
我可以说最好的是选项 3,因为它是唯一的一个不需要在开发电脑上安装任何东西。
对于 UmlGraphDoc 和 apiviz(均为 doclet),他们需要在 PC 中安装 GraphViz。
安装它并配置 maven-javadoc-plugin 很容易,但由于它们需要一个单独的应用程序,所以它使 UML 生成有点脏,因为如果您想将 uml 生成作为 Maven 生命周期的一部分,所有其他开发人员需要安装 GraphViz(我真正想避免的依赖项)。
不管怎样,这个链接有我遵循的使用 yworks 的方法(它确实有效):
如下我的3次配置尝试,以防万一您想确认是哪一个自己更好:
第一次尝试:UmlGraphDoc
它需要安装graphviz-2.38(google一下,很容易找到)
图表很丑,但可以理解!
第二次尝试:Apiviz
它还需要安装 graphviz-2.38(Google 一下,很容易找到)
生成的图表比第一个选项更好......
第三次尝试(ywork)(我推荐这个)
图表更容易理解,更广泛,更酷:D
它不需要在您的电脑上安装任何东西,您只需从其网站下载 yworks-uml-doclet-3.0_02-jdk1.5 并将其放在您的 pom.xml 附近,然后使用相对路径即可找到并使用它如下:
I tried 3 ways of doing this, generating UML Diagrams inside the JavaDocs using maven-javadoc-plugin and doclets:
1) UmlGraphDoc
2) apiviz
3) yworks
And I may say that the best is the option 3, this because it's the only one that does not need to install something in the development pc.
For UmlGraphDoc and apiviz (both doclets) they required to install GraphViz in the PC.
Install it and configure the maven-javadoc-plugin is easy, but since they required a separate application, it turns the UML generation a bit dirty, since if you want to include the uml generation as part of your maven lifecycle, all the other developers will need to install GraphViz (A dependency that I really wanted to avoid).
Anyway, this link has the approach I followed, of using yworks (it really works):
As follows my 3 tries of configuration, just in case you want to confirm which one is better by yourself:
1st try : UmlGraphDoc
It requires to install graphviz-2.38 (google it, it's easy to find)
Diagrams are quite ugly, but understandable!!
2nd try :Apiviz
It also requires to install graphviz-2.38 (Google it, it's easy to find)
Diagrams generated are nicer than first option...
3th try (ywork) (I recommend this one)
Diagrams are much more understandable and wide more cooler :D
It does not requires to install anything on your pc, you just need to download yworks-uml-doclet-3.0_02-jdk1.5 from its website and have it near your pom.xml, and using relative paths you can find it and use it as follows:
事实上,您提到的同一个 UMLGraph 包含 Javadoc 工具的备用 doclet,该工具将生成 UML 图作为 Javadoc 创建的一部分。我在这里找到了此信息: http://wiki.wsmoak.net/cgi-bin /wiki.pl?UMLGraph
In fact, the same UMLGraph that you mention includes an alternate doclet for the Javadoc tool that will generate UML diagrams as part of the Javadoc creation. I found this info here: http://wiki.wsmoak.net/cgi-bin/wiki.pl?UMLGraph