open source tool to generate Javadocs through Maven2 with automatic UML diagrams like ydoc [closed]

巧了我就是萌 提交于 2019-12-10 10:23:38

问题


I want to generate javadocs through maven's site generation plugin and I want to have automatic UML diagrams created and embedded in the javadoc.

The statsvn project uses yDoc to generate their UML documentation but I think they're using Maven1. yDoc is a commercial shareware product, so I'm unsure how the open source statsvn project integrates with it (or if there is a free version to use for javadoc generation).

Example svnstat yDoc javadoc: ChurnPageMaker.java

svnstat includes ydoc as a plugin to their Maven1 report generation: project.xml

    <reports>
            <report>maven-ydoc-plugin</report>
 ...
    </reports>

The yDoc documentation says you can use Maven2's custom javadoc doclet approach (but I can't figure out where to download yDoc or if it's free). It seems like the statsvn project is using yDoc so I'm guessing it's free?

Are there any other open source Javadoc doclet generators that integrate with Maven2 to generate javadocs with embedded class diagrams.


回答1:


It looks like the APIViz doclet support Maven2 javadoc plugin to generate class diagrams in javadoc.

  <reporting>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <doclet>org.jboss.apiviz.APIviz</doclet>
          <docletArtifact>
            <groupId>org.jboss.apiviz</groupId>
            <artifactId>apiviz</artifactId>
            <version>1.3.0.GA</version>
          </docletArtifact>
          <useStandardDocletOptions>true</useStandardDocletOptions>
          <charset>UTF-8</charset>
          <encoding>UTF-8</encoding>
          <docencoding>UTF-8</docencoding>
          <breakiterator>true</breakiterator>
          <version>true</version>
          <author>true</author>
          <keywords>true</keywords>
          <additionalparam>
            -sourceclasspath ${project.build.outputDirectory}
          </additionalparam>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </reporting>



回答2:


For Maven 2, have a look at http://maven.apache.org/plugins/maven-javadoc-plugin/examples/alternate-doclet.html which describes how to include UmlGraph diagrams in the javadoc of your code (requires Graphviz binary on the PATH). Below a sample POM using UmlGraph as alternate doclet:

<project>
  ...
  <reporting> (or <build>)
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.6.1</version>
        <configuration>
          <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
          <!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
          <docletArtifact>
            <groupId>org.umlgraph</groupId>
            <artifactId>doclet</artifactId>
            <version>5.1</version>
          </docletArtifact>
          <additionalparam>-views</additionalparam>
          <useStandardDocletOptions>true</useStandardDocletOptions>
        </configuration>
      </plugin>
    ...
    </plugins>
  </reporting> (or </build>)
  ...
</project>



回答3:


I know you want java docs, but have you checked out Doxygen? Perhaps it can do what you want. Here's a question comparing Javadocs and Doxygen.



来源:https://stackoverflow.com/questions/1712125/open-source-tool-to-generate-javadocs-through-maven2-with-automatic-uml-diagrams

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!