MNG-5582: Continue to track all the projects in the reactor even if the set is constrained by --projects

This commit is contained in:
Jason van Zyl 2014-02-10 14:56:06 -05:00
parent 2a0454caec
commit 8d489a2deb
2 changed files with 26 additions and 1 deletions

View File

@ -248,6 +248,10 @@ public class DefaultMaven
try
{
projects = getProjectsForMavenReactor( session );
//
// Capture the full set of projects before any potential constraining is performed by --projects
//
session.setAllProjects( projects );
}
catch ( ProjectBuildingException e )
{

View File

@ -60,10 +60,17 @@ public class MavenSession
/**
* These projects have already been topologically sorted in the {@link org.apache.maven.Maven} component before
* being passed into the session.
* being passed into the session. This is also the potentially constrained set of projects by using --projects
* on the command line.
*/
private List<MavenProject> projects;
/**
* The full set of projects before any potential constraining by --projects. Useful in the case where you want to
* build a smaller set of projects but perform other operations in the context of your reactor.
*/
private List<MavenProject> allProjects;
private MavenProject topLevelProject;
private ProjectDependencyGraph projectDependencyGraph;
@ -404,4 +411,18 @@ public class MavenSession
{
return projectMap;
}
/** This is a provisional method and may be removed */
public List<MavenProject> getAllProjects()
{
return allProjects;
}
/** This is a provisional method and may be removed */
public void setAllProjects( List<MavenProject> allProjects )
{
this.allProjects = allProjects;
}
}