org.apache.maven.plugin.reactor
Class SuperProjectSorter
java.lang.Object
org.apache.maven.plugin.reactor.SuperProjectSorter
public class SuperProjectSorter
- extends java.lang.Object
Sort projects by dependencies. Just like ProjectSorter from maven-project, but this one exposes
the DAG and the projectMap in getters.
- Author:
- Dan Fabulich, Brett Porter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SuperProjectSorter
public SuperProjectSorter(java.util.List projects)
throws org.codehaus.plexus.util.dag.CycleDetectedException,
org.apache.maven.project.DuplicateProjectException
- Sort a list of projects.
- collect all the vertices for the projects that we want to build.
- iterate through the deps of each project and if that dep is within
the set of projects we want to build then add an edge, otherwise throw
the edge away because that dependency is not within the set of projects
we are trying to build. we assume a closed set.
- do a topo sort on the graph that remains.
- Throws:
org.apache.maven.project.DuplicateProjectException
- if any projects are duplicated by id
org.codehaus.plexus.util.dag.CycleDetectedException
getTopLevelProject
public org.apache.maven.project.MavenProject getTopLevelProject()
getSortedProjects
public java.util.List getSortedProjects()
hasMultipleProjects
public boolean hasMultipleProjects()
getDependents
public java.util.List getDependents(java.lang.String id)
getDAG
public org.codehaus.plexus.util.dag.DAG getDAG()
getProjectMap
public java.util.Map getProjectMap()
Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.