Generating UML diagram from Java source code

Sometimes we may need to generate UML diagrams from source codes. Here’s what I do for Java code: graphviz + ant + UMLGraph. Details below:

1. Install graphviz and ant, download UMLGraph fromĀ http://www.umlgraph.org/

2. Place UMLGraph.jar in your project, for example, under
lib/

3. Write or modify your ant script, for example:

4. Run this ant script.

5. You will get the UML class diagram as expected in the generated Java docs. Here’s one example (click to enlarge):

com.andryy.hccdroid

Leave a Reply

Your email address will not be published.