Skip to content

Instantly share code, notes, and snippets.

@good-vi
Last active November 21, 2018 14:09
Show Gist options
  • Select an option

  • Save good-vi/5223d5a3ad10a71a887091f99a042fd8 to your computer and use it in GitHub Desktop.

Select an option

Save good-vi/5223d5a3ad10a71a887091f99a042fd8 to your computer and use it in GitHub Desktop.
Uml in javadoc with maven+umlgraph (actual for 21.11.2018)
Don't forget install graphviz.
Ubuntu:
sudo apt-get install graphviz
I use this method for java8 project.
Watch pom example below.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--...-->
<!--This for adding mvn dependency from Git-->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!--...-->
<dependency>
<groupId>com.github.dspinellis</groupId>
<artifactId>UMLGraph</artifactId>
<!--Last succesfull build from https://jitpack.io/#dspinellis/UMLGraph (log is green)-->
<version>master-R5_7_2-g0967a91-84</version>
<scope>compile</scope>
</dependency>
<!--...-->
</dependencies>
<reporting>
<plugins>
<!--Dependency for UML plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
<!--End-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<!--Probably 3. html not supported, need fix Pattern.compile calls in UmlGraphDoc.java
(https://github.com/dspinellis/UMLGraph/issues/27)
-->
<version>2.10.4</version>
<configuration>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletArtifact>
<groupId>com.github.dspinellis</groupId>
<artifactId>UMLGraph</artifactId>
<version>master-R5_7_2-g0967a91-84</version>
</docletArtifact>
<additionalparam>
-inferrel
-inferdep
-autosize
-collapsible
-hide java.*
-collpackages
-qualify
-postfixpackage
-nodefontsize 9
-nodefontpackagesize 7
-link http://docs.oracle.com/javase/8/docs/jdk/api/javadoc/doclet/
-link http://download.oracle.com/javase/8/docs/api/
</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>
</plugins>
</reporting>
<!--...-->
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment