org.fusesource.mvnplugins.graph
Class ProjectMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.fusesource.mvnplugins.graph.ProjectMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ProjectReportMojo, ReactorMojo

public class ProjectMojo
extends org.apache.maven.plugin.AbstractMojo

Generates a graph image of the dependencies of the project using the graphviz tool 'dot'. You must have the 'dot' executable installed and in your path before using this goal.

Author:
Hiram Chirino
Is defined by the goal name:
project
Requires the dependencies in this specified scope:
compile|test|runtime

Field Summary
protected  org.apache.maven.artifact.resolver.ArtifactCollector artifactCollector
           
protected  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
           
protected  org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
           
protected  org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
           
protected  boolean cascade
          If true then the 'test scope' and 'optional' attributes are cascaded down to the dependencies of the original node.
protected  String direction
          The direction that the graph will be laid out in.
protected  boolean hideExternal
          If set to true if dependencies external to the reactor project should be hidden.
protected  boolean hideGroupId
          If set to true then the group id label will not be drawn.
protected  boolean hideOmitted
          If set to true, ommitted dependencies will not be drawn.
protected  boolean hideOptional
          If set to true optional dependencies are not drawn.
protected  boolean hidePoms
          If set to true pom dependencies are not drawn.
protected  String hideScopes
          A comma seperated list of scopes.
protected  boolean hideTransitive
          If set to true then depdencies not explicitly defined in the projects pom will not be drawn.
protected  boolean hideType
          If set to true then the module type label will not be drawn.
protected  boolean hideVersion
          If set to true then the version label will not be drawn.
protected  boolean keepDot
          If set to true then the intermidate dot file will not be deleted.
protected  String label
          The label for the graph.
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
           
protected  org.apache.maven.project.MavenProject project
           
protected  File target
          The file the diagram will be written to.
protected  org.apache.maven.shared.dependency.tree.DependencyTreeBuilder treeBuilder
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ProjectMojo()
           
 
Method Summary
protected  void collectProjects(ArrayList<org.apache.maven.project.MavenProject> projects)
           
 void execute()
           
 File getTarget()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

project

protected org.apache.maven.project.MavenProject project
Since:
1.0
Is defined by:
expression:
${project}
Is readonly.
Is required.

localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
Since:
1.0
Is defined by:
expression:
${localRepository}
Is readonly.
Is required.

artifactResolver

protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
Since:
1.0
Is a Plexus component defined by:
Is required.

artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
Since:
1.0
Is a Plexus component defined by:
Is readonly.
Is required.

artifactMetadataSource

protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
Since:
1.0
Is a Plexus component defined by:
Is readonly.
Is required.

artifactCollector

protected org.apache.maven.artifact.resolver.ArtifactCollector artifactCollector
Is a Plexus component defined by:
Is readonly.
Is required.

treeBuilder

protected org.apache.maven.shared.dependency.tree.DependencyTreeBuilder treeBuilder
Since:
1.0
Is a Plexus component defined by:
Is readonly.
Is required.

target

protected File target
The file the diagram will be written to. Must use a file extension that the dot command supports or just the '.dot' extension.

Is defined by:
expression:
${graph.target}
default-value:
${project.build.directory}/project-graph.png

hideOmitted

protected boolean hideOmitted
If set to true, ommitted dependencies will not be drawn. Dependencies are marked as ommitted if it would result in a resolution conflict.

Is defined by:
expression:
${hide-omitted}
default-value:
true

hideOptional

protected boolean hideOptional
If set to true optional dependencies are not drawn.

Is defined by:
expression:
${hide-optional}
default-value:
false

hideExternal

protected boolean hideExternal
If set to true if dependencies external to the reactor project should be hidden.

Is defined by:
expression:
${hide-external}
default-value:
false

hidePoms

protected boolean hidePoms
If set to true pom dependencies are not drawn.

Is defined by:
expression:
${hide-poms}
default-value:
true

hideScopes

protected String hideScopes
A comma seperated list of scopes. Dependencies which mach the specified scopes will not be drawn.
For example: runtime,test

Is defined by:
expression:
${hide-scope}

hideTransitive

protected boolean hideTransitive
If set to true then depdencies not explicitly defined in the projects pom will not be drawn.

Is defined by:
expression:
${hide-transitive}
default-value:
false

hideVersion

protected boolean hideVersion
If set to true then the version label will not be drawn.

Is defined by:
expression:
${hide-version}
default-value:
false

hideGroupId

protected boolean hideGroupId
If set to true then the group id label will not be drawn.

Is defined by:
expression:
${hide-group-id}
default-value:
false

hideType

protected boolean hideType
If set to true then the module type label will not be drawn.

Is defined by:
expression:
${hide-type}
default-value:
false

keepDot

protected boolean keepDot
If set to true then the intermidate dot file will not be deleted.

Is defined by:
expression:
${keep-dot}
default-value:
false

label

protected String label
The label for the graph.

Is defined by:
expression:
${graph.label}
default-value:
Depedency

cascade

protected boolean cascade
If true then the 'test scope' and 'optional' attributes are cascaded down to the dependencies of the original node.

Is defined by:
expression:
${graph.cascade}
default-value:
true

direction

protected String direction
The direction that the graph will be laid out in. it can be one of the following values:
TB LR BT RL
top to bottom, from left to right, from bottom to top, and from right to left, respectively

Is defined by:
expression:
${graph.direction}
default-value:
TB
Constructor Detail

ProjectMojo

public ProjectMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

collectProjects

protected void collectProjects(ArrayList<org.apache.maven.project.MavenProject> projects)

getTarget

public File getTarget()


Copyright © 2009-2010 Progress Software Inc.. All Rights Reserved.