o Fixed TCCL handling

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@798226 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-27 17:23:21 +00:00
parent 299a4c0843
commit e3f7710578
1 changed files with 20 additions and 11 deletions

View File

@ -309,23 +309,32 @@ public class DefaultProjectBuilder
reactorModelPool.put( model.getGroupId(), model.getArtifactId(), model.getVersion(), model.getPomFile() );
}
for ( InterimResult interimResult : interimResults )
ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
try
{
try
for ( InterimResult interimResult : interimResults )
{
ModelBuildingResult result = modelBuilder.build( interimResult.request, interimResult.result );
try
{
ModelBuildingResult result = modelBuilder.build( interimResult.request, interimResult.result );
MavenProject project = toProject( result, config, interimResult.listener );
MavenProject project = toProject( result, config, interimResult.listener );
results.add( new DefaultProjectBuildingResult( project, result.getProblems() ) );
}
catch ( ModelBuildingException e )
{
results.add( new DefaultProjectBuildingResult( interimResult.pomFile, e.getProblems() ) );
errors = true;
results.add( new DefaultProjectBuildingResult( project, result.getProblems() ) );
}
catch ( ModelBuildingException e )
{
results.add( new DefaultProjectBuildingResult( interimResult.pomFile, e.getProblems() ) );
errors = true;
}
}
}
finally
{
Thread.currentThread().setContextClassLoader( oldContextClassLoader );
}
if ( errors )
{