graph:dependencies

Full name:

org.kuali.maven.plugins:graph-maven-plugin:1.1.0-SNAPSHOT:dependencies

Description:

This mojo produces customizable graphs of Maven dependency trees.

By default, the complete dependency tree (including transitive dependencies) is graphed. Graphs can be filtered with include/exclude criteria for artifacts and with show/hide criteria for Maven scope and optional settings.

Two layout styles are supported - LINKED and FLAT.

In LINKED mode, the relationships between shared dependencies are shown. Each dependency included in the build is displayed on the graph only once. The connections between dependencies are presented by Graphviz algorithms as a directed hierarchical graph.

For a transitive dependency, LINKED mode illustrates why Maven includes it in the build.

For a shared dependency (eg commons-logging), LINKED mode shows what other libraries depend on it. LINKED mode also shows the decisions Maven makes when resolving conflicts between pom's that depend on different versions of the same artifact.

In FLAT mode, dependencies are displayed exactly how they are defined in the pom's. This style can make it easier to comprehend the dependency tree but relationships between shared dependencies are not drawn.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile|test|runtime.

Required Parameters

Name Type Since Description
direction Direction -

The direction for the graph layout. Valid values are TB, LR, BT, RL. Top to bottom, left to right, bottom to top, and right to left, respectively.


Default value is: TB.
file File -

The file the graph will be written to. The file extension can be any output format supported by Graphviz (png, jpg, gif, pdf, ...)


Default value is: ${project.build.directory}/graph/dependencies.png.
layout Layout -

The style for the graph layout. Valid options are LINKED and FLAT

In LINKED mode, the relationships between shared dependencies are shown. Each dependency included in the build is displayed on the graph only once. The connections between dependencies are presented by Graphviz algorithms as a directed hierarchical graph.

For a transitive dependency, LINKED mode illustrates why Maven includes it in the build.

For a shared dependency (eg commons-logging), LINKED mode shows what other libraries depend on it. LINKED mode also shows the decisions Maven makes when resolving conflicts between pom's that depend on different versions of the same artifact.

In FLAT mode, dependencies are displayed exactly how they are defined in the pom's. This style can make it easier to comprehend the dependency tree but relationships between shared dependencies are not drawn.


Default value is: LINKED.

Optional Parameters

Name Type Since Description
cascadeOptional boolean -

If true, any dependency marked as optional will have all of its transitive dependencies displayed as optional also.


Default value is: true.
depth int -

Restricts the depth of the dependency tree.

To show only the dependencies of the current project, set this to 1. To show the dependencies of the current project and their direct dependencies, set this to 2.


Default value is: -1.
excludes String -

Comma delimited list of artifact patterns to exclude. The pattern syntax has the form - [groupId]:[artifactId]:[type]:[classifier]:[version]

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

For example:

Exclude commons-logging     -Dgraph.excludes=commons-logging
Exclude logging in general  -Dgraph.excludes=commons-logging,org.slf4j,log4j
Exclude war files           -Dgraph.excludes=*:*:war
Exclude source              -Dgraph.excludes=:::sources

If exclude patterns are provided, a match with any exclude pattern will prevent a dependency (and the dependency tree beneath it) from being displayed.

Exclude patterns override include patterns.

If not provided, no artifacts are excluded.


executeDot boolean -

If true, the Graphviz "dot" binary is executed to produce a graph from the .dot text file


Default value is: true.
filterType FilterType -

Controls how filtering is applied to the tree. Valid options are HIDE, PATH

HIDE prunes the tree from the top down. The dependency tree is traversed and any node that does not match the filter criteria is removed (along with its entire sub-tree) from the graph.

PATH searches the tree for any nodes that match the filter criteria. All matching nodes are displayed and all nodes in the path back to the root from all matching nodes are displayed as well.


Default value is: HIDE.
hide String -

Comma delimited list of patterns for hiding artifacts. The pattern syntax has the form - [scope]:[optional|required]

Scopes: compile,provided,runtime,test,system,import

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

For example:

Hide test dependencies             -Dgraph.hide=test
Hide test & provided dependencies  -Dgraph.hide=test,provided
Hide optional dependencies         -Dgraph.hide=*:optional
Hide required dependencies         -Dgraph.hide=*:required

If hide patterns are provided, a match with any hide pattern will prevent a dependency (and the dependency tree beneath it) from being displayed.

Hide patterns override show patterns.

If not provided, no dependencies are hidden.


ignoreDotFailure boolean -

If true, the Maven build will continue even if the "dot" executable returns a non-zero exit value.


Default value is: false.
includes String -

Comma delimited list of patterns for including artifacts. The pattern syntax has the form - [groupId]:[artifactId]:[type]:[classifier]:[version]

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

If include patterns are provided, a dependency must match one of the include patterns or it (along with the dependency tree beneath it) will be hidden.

If not provided, all dependencies are included.

Include patterns are overridden by exclude patterns.


keepDotFile boolean -

If true, the .dot text file Graphviz uses to draw the graph is retained


Default value is: false.
show String -

Comma delimited list of patterns for showing artifacts. The pattern syntax has the form - [scope]:[optional|required]

Scopes: compile,provided,runtime,test,system,import

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

If show patterns are provided a dependency must match one of the show patterns or it (along with the dependency tree beneath it) will be hidden.

Show patterns are overridden by hide patterns.

If not provided, all artifacts are shown.


showConflicts boolean -

If true, dependency conflicts are displayed on the graph


Default value is: true.
showDuplicates boolean -

If true, duplicate dependencies are displayed on the graph.


Default value is: false.
showGroupIds boolean -

If true, artifact group id's are displayed on the graph.


Default value is: true.
showLegend boolean -

If true, any filters applied to the dependency tree are shown in the legend.


Default value is: true.
showTitle boolean -

If true, the title for the graph will be displayed.


Default value is: true.
skip boolean -

If true, mojo execution is skipped.


Default value is: false.
skipEmptyGraphs boolean -

If true, do not invoke Graphviz if there are no dependencies to graph.


Default value is: true.
title String -

The title for the graph


Default value is: Dependency Graph for ${project.name}.
transitive boolean -

If true, transitive dependencies are graphed.


Default value is: true.
verbose boolean -

If true, metadata about the dependency tree is displayed.


Default value is: false.

Parameter Details

cascadeOptional:

If true, any dependency marked as optional will have all of its transitive dependencies displayed as optional also.

  • Type: boolean
  • Required: No
  • Expression: ${graph.cascadeOptional}
  • Default: true

depth:

Restricts the depth of the dependency tree.

To show only the dependencies of the current project, set this to 1. To show the dependencies of the current project and their direct dependencies, set this to 2.

  • Type: int
  • Required: No
  • Expression: ${graph.depth}
  • Default: -1

direction:

The direction for the graph layout. Valid values are TB, LR, BT, RL. Top to bottom, left to right, bottom to top, and right to left, respectively.

  • Type: org.kuali.maven.plugins.graph.pojo.Direction
  • Required: Yes
  • Expression: ${graph.direction}
  • Default: TB

excludes:

Comma delimited list of artifact patterns to exclude. The pattern syntax has the form - [groupId]:[artifactId]:[type]:[classifier]:[version]

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

For example:

Exclude commons-logging     -Dgraph.excludes=commons-logging
Exclude logging in general  -Dgraph.excludes=commons-logging,org.slf4j,log4j
Exclude war files           -Dgraph.excludes=*:*:war
Exclude source              -Dgraph.excludes=:::sources

If exclude patterns are provided, a match with any exclude pattern will prevent a dependency (and the dependency tree beneath it) from being displayed.

Exclude patterns override include patterns.

If not provided, no artifacts are excluded.

  • Type: java.lang.String
  • Required: No
  • Expression: ${graph.excludes}

executeDot:

If true, the Graphviz "dot" binary is executed to produce a graph from the .dot text file

  • Type: boolean
  • Required: No
  • Expression: ${graph.executeDot}
  • Default: true

file:

The file the graph will be written to. The file extension can be any output format supported by Graphviz (png, jpg, gif, pdf, ...)

  • Type: java.io.File
  • Required: Yes
  • Expression: ${graph.file}
  • Default: ${project.build.directory}/graph/dependencies.png

filterType:

Controls how filtering is applied to the tree. Valid options are HIDE, PATH

HIDE prunes the tree from the top down. The dependency tree is traversed and any node that does not match the filter criteria is removed (along with its entire sub-tree) from the graph.

PATH searches the tree for any nodes that match the filter criteria. All matching nodes are displayed and all nodes in the path back to the root from all matching nodes are displayed as well.

  • Type: org.kuali.maven.plugins.graph.pojo.FilterType
  • Required: No
  • Expression: ${graph.filterType}
  • Default: HIDE

hide:

Comma delimited list of patterns for hiding artifacts. The pattern syntax has the form - [scope]:[optional|required]

Scopes: compile,provided,runtime,test,system,import

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

For example:

Hide test dependencies             -Dgraph.hide=test
Hide test & provided dependencies  -Dgraph.hide=test,provided
Hide optional dependencies         -Dgraph.hide=*:optional
Hide required dependencies         -Dgraph.hide=*:required

If hide patterns are provided, a match with any hide pattern will prevent a dependency (and the dependency tree beneath it) from being displayed.

Hide patterns override show patterns.

If not provided, no dependencies are hidden.

  • Type: java.lang.String
  • Required: No
  • Expression: ${graph.hide}

ignoreDotFailure:

If true, the Maven build will continue even if the "dot" executable returns a non-zero exit value.

  • Type: boolean
  • Required: No
  • Expression: ${graph.ignoreDotFailure}
  • Default: false

includes:

Comma delimited list of patterns for including artifacts. The pattern syntax has the form - [groupId]:[artifactId]:[type]:[classifier]:[version]

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

If include patterns are provided, a dependency must match one of the include patterns or it (along with the dependency tree beneath it) will be hidden.

If not provided, all dependencies are included.

Include patterns are overridden by exclude patterns.

  • Type: java.lang.String
  • Required: No
  • Expression: ${graph.includes}

keepDotFile:

If true, the .dot text file Graphviz uses to draw the graph is retained

  • Type: boolean
  • Required: No
  • Expression: ${graph.keepDotFile}
  • Default: false

layout:

The style for the graph layout. Valid options are LINKED and FLAT

In LINKED mode, the relationships between shared dependencies are shown. Each dependency included in the build is displayed on the graph only once. The connections between dependencies are presented by Graphviz algorithms as a directed hierarchical graph.

For a transitive dependency, LINKED mode illustrates why Maven includes it in the build.

For a shared dependency (eg commons-logging), LINKED mode shows what other libraries depend on it. LINKED mode also shows the decisions Maven makes when resolving conflicts between pom's that depend on different versions of the same artifact.

In FLAT mode, dependencies are displayed exactly how they are defined in the pom's. This style can make it easier to comprehend the dependency tree but relationships between shared dependencies are not drawn.

  • Type: org.kuali.maven.plugins.graph.pojo.Layout
  • Required: Yes
  • Expression: ${graph.layout}
  • Default: LINKED

show:

Comma delimited list of patterns for showing artifacts. The pattern syntax has the form - [scope]:[optional|required]

Scopes: compile,provided,runtime,test,system,import

Each pattern segment is optional and supports the use of the asterisk "*" as a wildcard. An empty pattern segment is treated as a wildcard.

If show patterns are provided a dependency must match one of the show patterns or it (along with the dependency tree beneath it) will be hidden.

Show patterns are overridden by hide patterns.

If not provided, all artifacts are shown.

  • Type: java.lang.String
  • Required: No
  • Expression: ${graph.show}

showConflicts:

If true, dependency conflicts are displayed on the graph

  • Type: boolean
  • Required: No
  • Expression: ${graph.showConflicts}
  • Default: true

showDuplicates:

If true, duplicate dependencies are displayed on the graph.

  • Type: boolean
  • Required: No
  • Expression: ${graph.showDuplicates}
  • Default: false

showGroupIds:

If true, artifact group id's are displayed on the graph.

  • Type: boolean
  • Required: No
  • Expression: ${graph.showGroupIds}
  • Default: true

showLegend:

If true, any filters applied to the dependency tree are shown in the legend.

  • Type: boolean
  • Required: No
  • Expression: ${graph.showLegend}
  • Default: true

showTitle:

If true, the title for the graph will be displayed.

  • Type: boolean
  • Required: No
  • Expression: ${graph.showTitle}
  • Default: true

skip:

If true, mojo execution is skipped.

  • Type: boolean
  • Required: No
  • Expression: ${graph.skip}
  • Default: false

skipEmptyGraphs:

If true, do not invoke Graphviz if there are no dependencies to graph.

  • Type: boolean
  • Required: No
  • Expression: ${graph.skipEmptyGraphs}
  • Default: true

title:

The title for the graph

  • Type: java.lang.String
  • Required: No
  • Expression: ${graph.title}
  • Default: Dependency Graph for ${project.name}

transitive:

If true, transitive dependencies are graphed.

  • Type: boolean
  • Required: No
  • Expression: ${graph.transitive}
  • Default: true

verbose:

If true, metadata about the dependency tree is displayed.

  • Type: boolean
  • Required: No
  • Expression: ${graph.verbose}
  • Default: false