org.apache.maven.plugin.dependency
Class TreeMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.dependency.TreeMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

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

Displays the dependency tree for this project.

Since:
2.0-alpha-5
Version:
$Id: TreeMojo.java 1085777 2011-03-26 18:13:19Z hboutemy $
Author:
Mark Hobson
Is defined by the goal name:
tree
Requires the dependencies in this specified scope:
test

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
TreeMojo()
           
 
Method Summary
static boolean containsVersion(org.apache.maven.artifact.versioning.VersionRange allowedRange, org.apache.maven.artifact.versioning.ArtifactVersion theVersion)
          Copied from Artifact.VersionRange.
 void execute()
           
 org.apache.maven.shared.dependency.tree.DependencyNode getDependencyTree()
          Gets the computed dependency tree root node for the Maven project.
 org.apache.maven.project.MavenProject getProject()
          Gets the Maven project used by this mojo.
 org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor getSerializingDependencyNodeVisitor(Writer writer)
           
 
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
 

Constructor Detail

TreeMojo

public TreeMojo()
Method Detail

execute

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

getProject

public org.apache.maven.project.MavenProject getProject()
Gets the Maven project used by this mojo.

Returns:
the Maven project

getDependencyTree

public org.apache.maven.shared.dependency.tree.DependencyNode getDependencyTree()
Gets the computed dependency tree root node for the Maven project.

Returns:
the dependency tree root node

getSerializingDependencyNodeVisitor

public org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor getSerializingDependencyNodeVisitor(Writer writer)

containsVersion

public static boolean containsVersion(org.apache.maven.artifact.versioning.VersionRange allowedRange,
                                      org.apache.maven.artifact.versioning.ArtifactVersion theVersion)
Copied from Artifact.VersionRange. This is tweaked to handle singular ranges properly. Currently the default containsVersion method assumes a singular version means allow everything. This method assumes that "2.0.4" == "[2.0.4,)"

Parameters:
allowedRange - range of allowed versions.
theVersion - the version to be checked.
Returns:
true if the version is contained by the range.


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.