As technical documentation for my Java software projects often makes use of technologies like AsciiDoctor and PlantUML, having a tool to analyze existing structures and generating class diagrams from it, is a nice thing.

Luckily, the Maven plugin from the Living Documentation Project does all the work for me here.

Setup

We just need to add the following Maven plugin to our project’s pom.xml:

<plugin>
  <groupId>ch.ifocusit.livingdoc</groupId>
  <artifactId>livingdoc-maven-plugin</artifactId>
  <version>1.2</version>
  <executions>
    <execution>
      <id>class-diagram</id>
      <phase>package</phase>
      <goals>
        <goal>diagram</goal>
        <goal>glossary</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <packageRoot>com.hascode</packageRoot>
    <interactive>true</interactive>
  </configuration>
</plugin>

Generating AsciiDoc and Diagrams

As we have bound the plugin to the package Phase, we simply need to run this Maven goal:

./mvnw clean package

Result

Todo, add some screenshots and co …​.