Class TreeMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.dependency.tree.TreeMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="tree", requiresDependencyCollection=TEST, threadSafe=true) public class TreeMojo extends org.apache.maven.plugin.AbstractMojo
Displays the dependency tree for this project.- Since:
- 2.0-alpha-5
- Author:
- Mark Hobson
-
-
Constructor Summary
Constructors Constructor Description TreeMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.graph.DependencyNode
getDependencyGraph()
Gets the computed dependency graph 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.graph.traversal.DependencyNodeVisitor
getSerializingDependencyNodeVisitor(Writer writer)
boolean
isSkip()
void
setSkip(boolean skip)
-
-
-
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
-
getDependencyGraph
public org.apache.maven.shared.dependency.graph.DependencyNode getDependencyGraph()
Gets the computed dependency graph root node for the Maven project.- Returns:
- the dependency tree root node
-
isSkip
public boolean isSkip()
- Returns:
skip
-
setSkip
public void setSkip(boolean skip)
- Parameters:
skip
-skip
-
getSerializingDependencyNodeVisitor
public org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor getSerializingDependencyNodeVisitor(Writer writer)
- Parameters:
writer
-Writer
- Returns:
DependencyNodeVisitor
-
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.
-
-