o Allowed event spy to monitor project dependency graph

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1069935 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2011-02-11 20:04:37 +00:00
parent 9b83675025
commit 74840dab1a
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import org.apache.maven.RepositoryUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.eventspy.internal.EventSpyDispatcher;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.project.DefaultDependencyResolutionRequest;
@ -61,6 +62,9 @@ public class LifecycleDependencyResolver
@Requirement
private ArtifactFactory artifactFactory;
@Requirement
private EventSpyDispatcher eventSpyDispatcher;
@SuppressWarnings({"UnusedDeclaration"})
public LifecycleDependencyResolver()
{
@ -162,6 +166,8 @@ public class LifecycleDependencyResolver
new DefaultDependencyResolutionRequest( project, session.getRepositorySession() );
request.setResolutionFilter( resolutionFilter );
eventSpyDispatcher.onEvent( request );
result = dependenciesResolver.resolve( request );
}
catch ( DependencyResolutionException e )
@ -191,6 +197,8 @@ public class LifecycleDependencyResolver
}
}
eventSpyDispatcher.onEvent( result );
Set<Artifact> artifacts = new LinkedHashSet<Artifact>();
if ( result.getDependencyGraph() != null && !result.getDependencyGraph().getChildren().isEmpty() )
{