mirror of https://github.com/apache/maven.git
[MNG-7391] Fix MojosExecutionStrategy lookup to be able to look into the SessionScope (#692)
This commit is contained in:
parent
5220420212
commit
3a5a40c6d2
|
@ -38,8 +38,10 @@ import org.apache.maven.plugin.PluginIncompatibleException;
|
||||||
import org.apache.maven.plugin.PluginManagerException;
|
import org.apache.maven.plugin.PluginManagerException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
|
import org.codehaus.plexus.PlexusContainer;
|
||||||
import org.codehaus.plexus.component.annotations.Component;
|
import org.codehaus.plexus.component.annotations.Component;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
|
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
import org.eclipse.aether.SessionData;
|
import org.eclipse.aether.SessionData;
|
||||||
|
|
||||||
|
@ -88,7 +90,7 @@ public class MojoExecutor
|
||||||
private final ReadWriteLock aggregatorLock = new ReentrantReadWriteLock();
|
private final ReadWriteLock aggregatorLock = new ReentrantReadWriteLock();
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private MojosExecutionStrategy mojosExecutionStrategy;
|
private PlexusContainer container;
|
||||||
|
|
||||||
public MojoExecutor()
|
public MojoExecutor()
|
||||||
{
|
{
|
||||||
|
@ -159,7 +161,16 @@ public class MojoExecutor
|
||||||
|
|
||||||
final PhaseRecorder phaseRecorder = new PhaseRecorder( session.getCurrentProject() );
|
final PhaseRecorder phaseRecorder = new PhaseRecorder( session.getCurrentProject() );
|
||||||
|
|
||||||
mojosExecutionStrategy.execute( mojoExecutions, session, new MojoExecutionRunner()
|
MojosExecutionStrategy strategy;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
strategy = container.lookup( MojosExecutionStrategy.class );
|
||||||
|
}
|
||||||
|
catch ( ComponentLookupException e )
|
||||||
|
{
|
||||||
|
throw new IllegalStateException( "Unable to lookup MojosExecutionStrategy", e );
|
||||||
|
}
|
||||||
|
strategy.execute( mojoExecutions, session, new MojoExecutionRunner()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run( MojoExecution mojoExecution ) throws LifecycleExecutionException
|
public void run( MojoExecution mojoExecution ) throws LifecycleExecutionException
|
||||||
|
|
Loading…
Reference in New Issue