}
reactorProjects.add(project);
}
ReactorManager reactorManager = new ReactorManager(reactorProjects);
MavenSession newSession = new MavenSession(
oldSession.getContainer()
,oldSession.getSettings()
,oldSession.getLocalRepository()
,oldSession.getEventDispatcher()
,reactorManager
,oldSession.getGoals()
,oldSession.getExecutionRootDirectory()
,oldSession.getExecutionProperties()
,oldSession.getUserProperties()
,oldSession.getStartTime()
);
//in case of maven 3
try
{
Method setProjectsMethod = newSession.getClass().getMethod("setProjects",List.class);
setProjectsMethod.invoke(newSession,reactorManager.getSortedProjects());
}
catch (Exception ignore)
{
//ignore
}