io.github.dibog:pom-to-dot-maven-plugin-demo

Displays the hierarchical structure of POM as DOT files.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

io.github.dibog
ArtifactId

ArtifactId

pom-to-dot-maven-plugin-demo
Last Version

Last Version

1.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

Displays the hierarchical structure of POM as DOT files.

Download pom-to-dot-maven-plugin-demo

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.dibog/pom-to-dot-maven-plugin-demo/ -->
<dependency>
    <groupId>io.github.dibog</groupId>
    <artifactId>pom-to-dot-maven-plugin-demo</artifactId>
    <version>1.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.dibog/pom-to-dot-maven-plugin-demo/
implementation 'io.github.dibog:pom-to-dot-maven-plugin-demo:1.4.0'
// https://jarcasting.com/artifacts/io.github.dibog/pom-to-dot-maven-plugin-demo/
implementation ("io.github.dibog:pom-to-dot-maven-plugin-demo:1.4.0")
'io.github.dibog:pom-to-dot-maven-plugin-demo:jar:1.4.0'
<dependency org="io.github.dibog" name="pom-to-dot-maven-plugin-demo" rev="1.4.0">
  <artifact name="pom-to-dot-maven-plugin-demo" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.dibog', module='pom-to-dot-maven-plugin-demo', version='1.4.0')
)
libraryDependencies += "io.github.dibog" % "pom-to-dot-maven-plugin-demo" % "1.4.0"
[io.github.dibog/pom-to-dot-maven-plugin-demo "1.4.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.2.40

test (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-test jar 1.2.40

Project Modules

There are no modules declared in this project.

POM-to-DOT

License

This project is licensed under the Apache License Version 2.0.

The copyright owner is Dieter Bogdoll.

Overview

This project provides a command line tool, to visualize the hierarchical POM structure with the help of DOT and GraphViz or PlantUML.

All dependencies are assumed to be in your local Maven repository.

There is also plugins to use PlantUML with some IDEs:

Command line

After you have build the project with maven, you can rename generator/target/pom-to-dot-generator-<VERSION>-jar-with-dependencies.jar into something shorter like pom-to-dot.jar:

Usage: pom-to-dot [OPTIONS]

Options:
  --coord MAVEN_COORD      Maven coordinates. Format:
                           groupId:artifactId:version[:packaging][:classifier]
  --include-dep RE         Regular Expression for only showing the selected ones
  --exclude-dep RE         Regular Expression for excluding the selected ones
  --out-file PATH          File into which the output should be written
  --output-mode MODE       Use DOT to create a .dot file, or PLANT_UML to be
                           used with PlantUML.
                           Defaults to 'DOT'.
  --color REGEX COLOR...   colors matchign groupIds with thes specified color.
  -h, --help               Show this message and exit

The shortest form to call this is like

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0

which would create a rather big dot file as all the dependencies which are transitively used will be printed onto the system console.

Whereas

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0 --out-file test.dot

stores the output into a file called test.dot.

Lets go a bit more in detail over each parameter:

  • --coord here you specify the root of the graph to be displayed.

  • --internal-dep here you can specify a regular expression which will be matched against the group id. The idea is to display your internal dependencies differently then the other dependencies.

  • --exclude-dep lets you specify a regular expression which will again be matched with the groupId. Every such matched dependency won't appear in the DOT file.

  • --color REGEX COLOR ... every dependency matching to the REGEX will be colored with COLOR. The parameter can be specified multiple times.

  • --executable lets you specify the Graphviz/dot binary

  • --output-mode can be either DOT, PLANT_UML, PNG, GIF, JPG, BMP, PS, EPS or SVG.

  • --out-file if set the output will be written in that file.

Maven Plugin

You can also automate the creating of the difference formats within your pom.xml.

All you have to do is to add the following maven plugin to your build section:

<plugin>
    <groupId>io.github.dibog</groupId>
    <artifactId>pom-to-dot-maven-plugin</artifactId>
    <version>${pom-to-dot.version}</version>
    <executions>
        <execution>
            <phase>install</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <coord>groupId:artifactId:version</coord>
                <out-file>.</out-file>
                <format>PNG</format>
                <include-dep>REGEX</include-dep>
                <exclude-dep>REGEX</exclude-dep>
                <executable>/path/to/graphviz/dot</executable>
                <colors>
                    <color>REGEX=color</color>
                    <color>REGEX=color</color>
                </colors>
            </configuration>
        </execution>
    </executions>
</plugin>
  • if is missing the coordiantes of the current pom.xml is used

Please refer to the Command line section for an explanation of the configuration parameters.

Examples for the Command line usage

Displaying the full dependencies of this project

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0 --output-mode PNG --out-file img/full.png

full.dot

Displaying only dependencies of group 'io.github.dibog' and 'org.jetbrains.kotlin'

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0 --include-dep "(io.github.dibog|org.jetbrains.kotlin)" --output-mode PNG --out-file img/include.png

include.dot

Display the dependencies without 'org.apache.maven' and 'org.jboss.shrinkwrap.resolver'

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0 --exclude-dep "(org.apache.maven|org.jboss.shrinkwrap.resolver)" --output-mode PNG --out-file img/exclude.png

exclude.dot

Display as above but with colored dependencies

java -jar pom-to-dot.jar --coord io.github.dibog:pom-to-dot:1.0.0 --exclude-dep "(org.apache.maven|org.jboss.shrinkwrap.resolver)" --colors "org.slf4j" yellow --colors "org.jetbrains.kotlin" green --output-mode PNG --out-file img/colored.png

colored.dot

Examples for the usage within a pom.xml

You can inspect this example pom.xml about how to use or configure the plugin.

Versions

Version
1.4.0
1.3.0