org.apache.maven.project
Class ProjectSorter
java.lang.Object
org.apache.maven.project.ProjectSorter
public class ProjectSorter
- extends Object
Sort projects by dependencies.
- Version:
- $Id: ProjectSorter.java 495147 2007-01-11 07:47:53Z jvanzyl $
- Author:
- Brett Porter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProjectSorter
public ProjectSorter(List projects)
throws org.codehaus.plexus.util.dag.CycleDetectedException,
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:
DuplicateProjectException
- if any projects are duplicated by id
org.codehaus.plexus.util.dag.CycleDetectedException
getTopLevelProject
public MavenProject getTopLevelProject()
getSortedProjects
public List getSortedProjects()
hasMultipleProjects
public boolean hasMultipleProjects()
getDependents
public List getDependents(String id)
Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.