Package org.apache.maven.graph
Class DefaultProjectDependencyGraph
java.lang.Object
org.apache.maven.graph.DefaultProjectDependencyGraph
- All Implemented Interfaces:
ProjectDependencyGraph
Describes the interdependencies between projects in the reactor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<MavenProject> private final Map<MavenProject, Integer> private final Map<String, MavenProject> private final ProjectSorter -
Constructor Summary
ConstructorsConstructorDescriptionDefaultProjectDependencyGraph(Collection<MavenProject> projects) Creates a new project dependency graph based on the specified projects.DefaultProjectDependencyGraph(Collection<MavenProject> allProjects, Collection<MavenProject> projects) Creates a new project dependency graph based on the specified projects.DefaultProjectDependencyGraph(List<MavenProject> allProjects, Collection<MavenProject> projects) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionGets all collected projects.private voidgetDownstreamProjects(String projectId, Set<String> projectIds, boolean transitive) getDownstreamProjects(MavenProject project, boolean transitive) Gets the downstream projects of the specified project.Gets all projects in their intended build order, i.e.private List<MavenProject> getSortedProjects(Set<String> projectIds) private voidgetUpstreamProjects(String projectId, Collection<String> projectIds, boolean transitive) getUpstreamProjects(MavenProject project, boolean transitive) Gets the upstream projects of the specified project.toString()
-
Field Details
-
sorter
-
allProjects
-
order
-
projects
-
-
Constructor Details
-
DefaultProjectDependencyGraph
public DefaultProjectDependencyGraph(Collection<MavenProject> projects) throws CycleDetectedException, DuplicateProjectException Creates a new project dependency graph based on the specified projects.- Parameters:
projects- The projects to create the dependency graph with- Throws:
DuplicateProjectExceptionCycleDetectedException
-
DefaultProjectDependencyGraph
@Deprecated public DefaultProjectDependencyGraph(List<MavenProject> allProjects, Collection<MavenProject> projects) throws CycleDetectedException, DuplicateProjectException Deprecated.Creates a new project dependency graph based on the specified projects.- Parameters:
allProjects- All collected projects.projects- The projects to create the dependency graph with.- Throws:
DuplicateProjectExceptionCycleDetectedException- Since:
- 3.5.0
-
DefaultProjectDependencyGraph
public DefaultProjectDependencyGraph(Collection<MavenProject> allProjects, Collection<MavenProject> projects) throws CycleDetectedException, DuplicateProjectException Creates a new project dependency graph based on the specified projects.- Parameters:
allProjects- All collected projects.projects- The projects to create the dependency graph with.- Throws:
DuplicateProjectExceptionCycleDetectedException- Since:
- 4.0.0
-
-
Method Details
-
getAllProjects
Description copied from interface:ProjectDependencyGraphGets all collected projects.- Specified by:
getAllProjectsin interfaceProjectDependencyGraph- Returns:
- All collected projects.
- Since:
- 3.5.0
-
getSortedProjects
Description copied from interface:ProjectDependencyGraphGets all projects in their intended build order, i.e. after topologically sorting the projects according to their interdependencies.- Specified by:
getSortedProjectsin interfaceProjectDependencyGraph- Returns:
- The projects in the build order, never
null.
-
getDownstreamProjects
Description copied from interface:ProjectDependencyGraphGets the downstream projects of the specified project. A downstream project is a project that directly or indirectly depends on the given project.- Specified by:
getDownstreamProjectsin interfaceProjectDependencyGraph- Parameters:
project- The project whose downstream projects should be retrieved, must not benull.transitive- A flag whether to retrieve all direct and indirect downstream projects or just the immediate downstream projects.- Returns:
- The downstream projects in the build order, never
null.
-
getDownstreamProjects
-
getUpstreamProjects
Description copied from interface:ProjectDependencyGraphGets the upstream projects of the specified project. An upstream project is a project that directly or indirectly is a prerequisite of the given project.- Specified by:
getUpstreamProjectsin interfaceProjectDependencyGraph- Parameters:
project- The project whose upstream projects should be retrieved, must not benull.transitive- A flag whether to retrieve all direct and indirect upstream projects or just the immediate upstream projects.- Returns:
- The upstream projects in the build order, never
null.
-
getUpstreamProjects
private void getUpstreamProjects(String projectId, Collection<String> projectIds, boolean transitive) -
getSortedProjects
-
toString
-
DefaultProjectDependencyGraph(Collection, Collection)instead.