o Avoided creation of broken ThreadLockedArtifact (i.e. don't wrap null artifacts)

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@980522 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-07-29 17:49:54 +00:00
parent 7c5b95fa26
commit f179e38933
1 changed files with 7 additions and 3 deletions

View File

@ -111,9 +111,10 @@ public class LifecycleWeaveBuilder
{
for ( MavenProject mavenProject : session.getProjects() )
{
if ( !( mavenProject.getArtifact() instanceof ThreadLockedArtifact ) )
Artifact mainArtifact = mavenProject.getArtifact();
if ( mainArtifact != null && !( mainArtifact instanceof ThreadLockedArtifact ) )
{
ThreadLockedArtifact threadLockedArtifact = new ThreadLockedArtifact( mavenProject.getArtifact() );
ThreadLockedArtifact threadLockedArtifact = new ThreadLockedArtifact( mainArtifact );
mavenProject.setArtifact( threadLockedArtifact );
}
}
@ -211,7 +212,10 @@ public class LifecycleWeaveBuilder
Iterator<ExecutionPlanItem> planItems = executionPlan.iterator();
ExecutionPlanItem current = planItems.hasNext() ? planItems.next() : null;
ThreadLockedArtifact threadLockedArtifact = (ThreadLockedArtifact)projectBuild.getProject().getArtifact();
if ( threadLockedArtifact != null )
{
threadLockedArtifact.attachToThread();
}
long buildStartTime = System.currentTimeMillis();
//muxer.associateThreadWithProjectSegment( projectBuild );