[MNG-4618] maven-javadoc-plugin aggregate-jar fails with maven3 and multiple modules

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@931086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-04-06 11:00:19 +00:00
parent bf506287ed
commit 37a0e64aa0
2 changed files with 19 additions and 9 deletions

View File

@ -124,11 +124,23 @@ public MavenSession( PlexusContainer container, MavenExecutionRequest request, M
public void setProjects( List<MavenProject> projects )
{
//TODO: Current for testing classes creating the session
if ( projects.size() > 0 )
if ( !projects.isEmpty() )
{
this.currentProject = projects.get( 0 );
this.topLevelProject = projects.get( 0 );
this.topLevelProject = currentProject;
for ( MavenProject project : projects )
{
if ( project.isExecutionRoot() )
{
topLevelProject = project;
break;
}
}
}
else
{
this.currentProject = null;
this.topLevelProject = null;
}
this.projects = projects;
}

View File

@ -451,18 +451,16 @@ private boolean build( List<ProjectBuildingResult> results, List<MavenProject> p
MavenProject project = interimResult.listener.getProject();
initProject( project, result );
projects.add( project );
results.add( new DefaultProjectBuildingResult( project, result.getProblems(), null ) );
project.setExecutionRoot( interimResult.root );
List<MavenProject> modules = new ArrayList<MavenProject>();
noErrors = build( results, modules, interimResult.modules, config ) && noErrors;
projects.addAll( modules );
projects.add( project );
project.setExecutionRoot( interimResult.root );
project.setCollectedProjects( modules );
results.add( new DefaultProjectBuildingResult( project, result.getProblems(), null ) );
}
catch ( ModelBuildingException e )
{