This plugin supports the rendering of Structurizr DSL views during the Maven build using different rendering algorithms including the same as provided by the Structurizr UI.
The plugin is configurable to support different renderers (C4-PlantUML, Mermaid and the Structurizr renderer used by the Structurizr Lite UI) and, when the latter is used, supports also manual layout files.
- NOTE
-
structurizr-renderer is used under the hood. For further details on usage and configuration, see its readme.
The following shows the different usage scenarios.
<plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-structurizr-auto-layout</id>
<phase>site</phase>
<goals>
<goal>export-diagrams</goal>
</goals>
<configuration>
<playwrightWsEndpoint>ws://localhost:3000/playwright/chromium</playwrightWsEndpoint> <!--(1)-->
<workspace>${project.basedir}/workspace-auto.dsl</workspace>
<renderer>STRUCTURIZR</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/structurizr/auto-layout</outputDir>
</configuration>
</execution>
</executions>
</plugin>-
Optionally configure a Playwright server to connect to instead of triggering local install.
<plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-structurizr-manual-layout</id>
<phase>site</phase>
<goals>
<goal>export-diagrams</goal>
</goals>
<configuration>
<playwrightWsEndpoint>ws://localhost:3000/playwright/chromium</playwrightWsEndpoint> <!--(1)-->
<workspace>${project.basedir}/workspace.dsl</workspace>
<workspaceJson>${project.basedir}/workspace.json</workspaceJson>
<renderer>STRUCTURIZR</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/structurizr/manual-layout</outputDir>
</configuration>
</execution>
</executions>
</plugin>-
Optionally configure a Playwright server to connect to instead of triggering local install.
<plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-c4-plantuml-graphviz</id>
<goals>
<goal>export-diagrams</goal>
</goals>
<phase>site</phase>
<configuration>
<workspace>${project.basedir}/workspace.dsl</workspace>
<plantumlLayoutEngine>GRAPHVIZ</plantumlLayoutEngine>
<renderer>PLANTUML_C4</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/c4-plantuml/graphviz</outputDir>
</configuration>
</execution>
</executions>
</plugin><plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-c4-plantuml-smetana</id>
<goals>
<goal>export-diagrams</goal>
</goals>
<phase>site</phase>
<configuration>
<workspace>${project.basedir}/workspace.dsl</workspace>
<plantumlLayoutEngine>SMETANA</plantumlLayoutEngine>
<renderer>PLANTUML_C4</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/c4-plantuml/smetana</outputDir>
</configuration>
</execution>
</executions>
</plugin><plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-c4-plantuml-elk</id>
<goals>
<goal>export-diagrams</goal>
</goals>
<phase>site</phase>
<configuration>
<workspace>${project.basedir}/workspace.dsl</workspace>
<plantumlLayoutEngine>ELK</plantumlLayoutEngine>
<renderer>PLANTUML_C4</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/c4-plantuml/elk</outputDir>
</configuration>
</execution>
</executions>
</plugin><plugin>
<groupId>de.materna.structurizr</groupId>
<artifactId>structurizr-maven-plugin</artifactId>
<version>${structurizr-maven-plugin.version}</version>
<executions>
<execution>
<id>render-mermaid</id>
<phase>install</phase>
<goals>
<goal>export-diagrams</goal>
</goals>
<configuration>
<workspace>${project.basedir}/workspace.dsl</workspace>
<renderer>MERMAID</renderer>
<outputDir>${project.build.directory}/structurizr-diagrams/mermaid</outputDir>
</configuration>
</execution>
</executions>
</plugin>