mirror of https://github.com/apache/maven.git
[MNG-4318] MavenProject.executionRoot is not set correctly
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@807526 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1faa467bb5
commit
a3eba702af
|
@ -293,7 +293,8 @@ public class DefaultProjectBuilder
|
||||||
|
|
||||||
ReactorModelCache modelCache = new ReactorModelCache();
|
ReactorModelCache modelCache = new ReactorModelCache();
|
||||||
|
|
||||||
boolean errors = build( results, interimResults, pomFiles, recursive, config, reactorModelPool, modelCache );
|
boolean errors =
|
||||||
|
build( results, interimResults, pomFiles, true, recursive, config, reactorModelPool, modelCache );
|
||||||
|
|
||||||
for ( InterimResult interimResult : interimResults )
|
for ( InterimResult interimResult : interimResults )
|
||||||
{
|
{
|
||||||
|
@ -312,6 +313,7 @@ public class DefaultProjectBuilder
|
||||||
ModelBuildingResult result = modelBuilder.build( interimResult.request, interimResult.result );
|
ModelBuildingResult result = modelBuilder.build( interimResult.request, interimResult.result );
|
||||||
|
|
||||||
MavenProject project = toProject( result, config, interimResult.listener );
|
MavenProject project = toProject( result, config, interimResult.listener );
|
||||||
|
project.setExecutionRoot( interimResult.root );
|
||||||
|
|
||||||
results.add( new DefaultProjectBuildingResult( project, result.getProblems(), null ) );
|
results.add( new DefaultProjectBuildingResult( project, result.getProblems(), null ) );
|
||||||
}
|
}
|
||||||
|
@ -338,7 +340,7 @@ public class DefaultProjectBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults,
|
private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults,
|
||||||
List<File> pomFiles, boolean recursive, ProjectBuildingRequest config,
|
List<File> pomFiles, boolean isRoot, boolean recursive, ProjectBuildingRequest config,
|
||||||
ReactorModelPool reactorModelPool, ReactorModelCache modelCache )
|
ReactorModelPool reactorModelPool, ReactorModelCache modelCache )
|
||||||
{
|
{
|
||||||
boolean errors = false;
|
boolean errors = false;
|
||||||
|
@ -360,7 +362,7 @@ public class DefaultProjectBuilder
|
||||||
|
|
||||||
Model model = result.getEffectiveModel();
|
Model model = result.getEffectiveModel();
|
||||||
|
|
||||||
interimResults.add( new InterimResult( pomFile, request, result, listener ) );
|
interimResults.add( new InterimResult( pomFile, request, result, listener, isRoot ) );
|
||||||
|
|
||||||
if ( recursive && !model.getModules().isEmpty() )
|
if ( recursive && !model.getModules().isEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -414,9 +416,11 @@ public class DefaultProjectBuilder
|
||||||
moduleFiles.add( moduleFile );
|
moduleFiles.add( moduleFile );
|
||||||
}
|
}
|
||||||
|
|
||||||
errors =
|
if ( build( results, interimResults, moduleFiles, false, recursive, config, reactorModelPool,
|
||||||
build( results, interimResults, moduleFiles, recursive, config, reactorModelPool, modelCache )
|
modelCache ) )
|
||||||
|| errors;
|
{
|
||||||
|
errors = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( ModelBuildingException e )
|
catch ( ModelBuildingException e )
|
||||||
|
@ -441,13 +445,16 @@ public class DefaultProjectBuilder
|
||||||
|
|
||||||
DefaultModelBuildingListener listener;
|
DefaultModelBuildingListener listener;
|
||||||
|
|
||||||
|
boolean root;
|
||||||
|
|
||||||
InterimResult( File pomFile, ModelBuildingRequest request, ModelBuildingResult result,
|
InterimResult( File pomFile, ModelBuildingRequest request, ModelBuildingResult result,
|
||||||
DefaultModelBuildingListener listener )
|
DefaultModelBuildingListener listener, boolean root )
|
||||||
{
|
{
|
||||||
this.pomFile = pomFile;
|
this.pomFile = pomFile;
|
||||||
this.request = request;
|
this.request = request;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
|
this.root = root;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue