PlantUML Maven Plugin :: Maven Plugin

Maven Plugin for generating diagrams from PlantUML sources

License

License

Categories

Categories

Maven Build Tools Ant UML Business Logic Libraries Documents Processing
GroupId

GroupId

it.mulders.puml
ArtifactId

ArtifactId

plantuml-maven-plugin
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

PlantUML Maven Plugin :: Maven Plugin
Maven Plugin for generating diagrams from PlantUML sources

Download plantuml-maven-plugin

How to add to project

<plugin>
    <groupId>it.mulders.puml</groupId>
    <artifactId>plantuml-maven-plugin</artifactId>
    <version>0.2</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
it.mulders.puml : plantuml-api jar 0.2
org.apache.maven : maven-plugin-api jar 3.1.0

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.18
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

test (4)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar
uk.org.lidalia : slf4j-test jar 1.2.0
org.assertj : assertj-core jar 3.19.0
org.mockito : mockito-core jar 3.8.0

Project Modules

There are no modules declared in this project.

PUML Maven Plugin

A Maven Plugin for generating diagrams from PlantUML sources

Run tests SonarCloud quality gate SonarCloud vulnerability count SonarCloud technical debt Dependabot Status Mutation testing badge Maven Central

Usage

Add the plugin to your POM.

<plugin>
    <groupId>it.mulders.puml</groupId>
    <artifactId>plantuml-maven-plugin</artifactId>
    <version>0.1</version>
    <dependencies>
        <!-- described below -->
    </dependencies>
    <configuration>
        <!-- described below -->
    </configuration>
</plugin>

The plugin needs two additional dependencies:

  1. An adapter for PlantUML
  2. PlantUML itself

For example:

    <dependencies>
        <dependency>
            <groupId>it.mulders.puml</groupId>
            <artifactId>plantuml-v1-adapter</artifactId>
            <version>@project.version@</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.plantuml</groupId>
            <artifactId>plantuml</artifactId>
            <version>1.2020.9</version>
        </dependency>
    </dependencies>

Finally, you can configure the plugin using the standard Maven plugin mechanism. Details are below.

The integration tests contain more examples which are verified with each build of the plugin.

Goals

This plugin provides one goal.

generate — Generates diagrams from a set of input files.

This goal takes a set of input files and generates a diagram for each of them. You can configure the goal using these parameters:

Input The set of input files as a FileSet
Name sourceFiles
Property plantuml.sourceFiles
Required? yes
Default value -
Output Where to place generated diagrams.
Name outputDirectory
Property plantuml.outputDirectory
Required? no
Default value ${project.build.directory}/plantuml
Path stripping A path to strip from each input file before building the output file name
Name stripPath
Property plantuml.stripPath
Required? yes
Default value -
Output format Format the diagrams should be generated in.
Name format
Property plantuml.format
Required? yes
Default value -
Values PNG, SVG

Path stripping

The plugin will remove the stripPath parameter from each input file name and then create the output file name from the remainder of the input file name.

To understand what this means, consider this example. Imagine an input file src/main/docs/diagrams/architecture/overview.puml and the default output directory, ${project.build.directory}/plantuml. Without path stripping, the output file would be ${project.build.directory}/plantuml/src/main/docs/diagrams/architecture/overview.puml. Path stripping lets you strip a part of the input file name, so the output location will be shorter.

In the above example, a value of src/main/docs for the stripPath parameter would result in the following output file: ${project.build.directory}/plantuml/diagrams/architecture/overview.puml.

PlantUML Adapters

To accommodate for changing versions of PlantUML, this plugin requires you to add an adapter. It is the adapters job to abstract the actual invocation of PlantUML. This should keep the plugin API stable regardless of which version of PlantUML you want to use.

A plugin does not pull in the actual version of PlantUML. This gives you the flexibility to specify the exact version of PlantUML you want to use in your project.

Development notes

Releases must be built with Java 8 and Maven 3.x (not 4.x at the time of writing). This is due to Maven 4's build/consumer, where the distributed POM is different from the one on disk. The Maven GPG Plugin isn't aware of this yet and signs the wrong POM...

Contributing

Do you have an idea for this plugin, or want to report a bug? All contributions are welcome! Feel free to file an issue with your idea, question or whatever it is you want to contribute.

License

The PUML Maven Plugin is licensed under the Apache License, version 2. See LICENSE for the full text of the license.

Versions

Version
0.2
0.1