mirror of https://github.com/apache/maven.git
o changing MavenLifecycleContext to MavenGoalExecutionContext which is what
it really is. Making way for the notion of a MavenSessionExecutionContext and it is looking like we will end up with two lifecycles. Where we are dealing with notions of goals and sessions: some operations need to be done at the session level and don't need to be repeated for the execution of every goal. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162968 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
133a51a629
commit
e232e07440
|
@ -17,7 +17,7 @@ package org.apache.maven;
|
|||
*/
|
||||
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleManager;
|
||||
import org.apache.maven.plugin.PluginManager;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
|
@ -105,13 +105,13 @@ public class DefaultMaven
|
|||
}
|
||||
*/
|
||||
|
||||
MavenLifecycleContext context;
|
||||
MavenGoalExecutionContext context;
|
||||
|
||||
try
|
||||
{
|
||||
//!! we may not know anything about the plugin at this point.
|
||||
|
||||
context = new MavenLifecycleContext( container,
|
||||
context = new MavenGoalExecutionContext( container,
|
||||
project,
|
||||
getMojoDescriptor( goal ),
|
||||
getLocalRepository() );
|
||||
|
|
|
@ -26,6 +26,6 @@ public abstract class AbstractMavenLifecyclePhase
|
|||
extends AbstractLogEnabled
|
||||
implements MavenLifecyclePhase
|
||||
{
|
||||
public abstract void execute( MavenLifecycleContext context )
|
||||
public abstract void execute( MavenGoalExecutionContext context )
|
||||
throws Exception;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class DefaultMavenLifecycleManager
|
|||
return lifecyclePhases;
|
||||
}
|
||||
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
for ( Iterator iterator = lifecyclePhases.iterator(); iterator.hasNext(); )
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.Set;
|
|||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MavenLifecycleContext
|
||||
public class MavenGoalExecutionContext
|
||||
{
|
||||
private String failedGoal;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class MavenLifecycleContext
|
|||
|
||||
private String goalName;
|
||||
|
||||
public MavenLifecycleContext( PlexusContainer container,
|
||||
public MavenGoalExecutionContext( PlexusContainer container,
|
||||
MavenProject project,
|
||||
MojoDescriptor goal,
|
||||
ArtifactRepository localRepository )
|
|
@ -26,7 +26,7 @@ public interface MavenLifecycleManager
|
|||
{
|
||||
String ROLE = MavenLifecycleManager.class.getName();
|
||||
|
||||
void execute( MavenLifecycleContext context )
|
||||
void execute( MavenGoalExecutionContext context )
|
||||
throws Exception;
|
||||
|
||||
List getLifecyclePhases();
|
||||
|
|
|
@ -27,7 +27,7 @@ public interface MavenLifecyclePhase
|
|||
{
|
||||
String ROLE = MavenLifecyclePhase.class.getName();
|
||||
|
||||
void execute( MavenLifecycleContext context )
|
||||
void execute( MavenGoalExecutionContext context )
|
||||
throws Exception;
|
||||
|
||||
void enableLogging( Logger logger );
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.util.Iterator;
|
|||
public class DependencyDownloadPhase
|
||||
extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
ArtifactResolver artifactResolver = null;
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
|
|||
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
||||
import org.apache.maven.artifact.MavenMetadataSource;
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
@ -32,7 +32,7 @@ import java.util.Iterator;
|
|||
public class DependencyResolutionPhase
|
||||
extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
for ( Iterator iterator = context.getResolvedGoals().iterator(); iterator.hasNext(); )
|
||||
|
@ -48,7 +48,7 @@ public class DependencyResolutionPhase
|
|||
}
|
||||
}
|
||||
|
||||
private void resolveTransitiveDependencies( MavenLifecycleContext context )
|
||||
private void resolveTransitiveDependencies( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
ArtifactResolver artifactResolver = null;
|
||||
|
|
|
@ -17,7 +17,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
*/
|
||||
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.plugin.OgnlProjectValueExtractor;
|
||||
import org.apache.maven.plugin.Plugin;
|
||||
import org.apache.maven.plugin.PluginExecutionRequest;
|
||||
|
@ -37,7 +37,7 @@ import java.util.Map;
|
|||
public class GoalAttainmentPhase
|
||||
extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
PluginExecutionResponse response;
|
||||
|
@ -82,7 +82,7 @@ public class GoalAttainmentPhase
|
|||
}
|
||||
}
|
||||
|
||||
private Map createParameters( MojoDescriptor goal, MavenLifecycleContext context )
|
||||
private Map createParameters( MojoDescriptor goal, MavenGoalExecutionContext context )
|
||||
{
|
||||
Map map = null;
|
||||
|
||||
|
@ -115,7 +115,7 @@ public class GoalAttainmentPhase
|
|||
return map;
|
||||
}
|
||||
|
||||
private void releaseComponents( MojoDescriptor goal, PluginExecutionRequest request, MavenLifecycleContext context )
|
||||
private void releaseComponents( MojoDescriptor goal, PluginExecutionRequest request, MavenGoalExecutionContext context )
|
||||
{
|
||||
if ( request != null && request.getParameters() != null )
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
import org.apache.maven.decoration.GoalDecorationParser;
|
||||
import org.apache.maven.decoration.GoalDecoratorBindings;
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class GoalDecorationPhase extends AbstractMavenLifecyclePhase
|
|||
private GoalDecoratorBindings decorators;
|
||||
private boolean decoratorsInitialized = false;
|
||||
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
synchronized ( this )
|
||||
|
@ -54,7 +54,7 @@ public class GoalDecorationPhase extends AbstractMavenLifecyclePhase
|
|||
context.setGoalDecoratorBindings(decorators);
|
||||
}
|
||||
|
||||
private void initializeDecorators( MavenLifecycleContext context )
|
||||
private void initializeDecorators( MavenGoalExecutionContext context )
|
||||
throws XmlPullParserException, IOException
|
||||
{
|
||||
MavenProject project = context.getProject( );
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.apache.maven.GoalNotFoundException;
|
|||
import org.apache.maven.decoration.GoalDecorator;
|
||||
import org.apache.maven.decoration.GoalDecoratorBindings;
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.plugin.PluginManager;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.Set;
|
|||
*/
|
||||
public class GoalResolutionPhase extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
PluginManager pluginManager = null;
|
||||
|
@ -65,7 +65,7 @@ public class GoalResolutionPhase extends AbstractMavenLifecyclePhase
|
|||
}
|
||||
}
|
||||
|
||||
private List resolveTopLevel( String goal, Set includedGoals, List results, MavenLifecycleContext context, PluginManager pluginManager )
|
||||
private List resolveTopLevel( String goal, Set includedGoals, List results, MavenGoalExecutionContext context, PluginManager pluginManager )
|
||||
{
|
||||
|
||||
// Retrieve the prereqs-driven execution path for this goal, using the DAG.
|
||||
|
@ -77,7 +77,7 @@ public class GoalResolutionPhase extends AbstractMavenLifecyclePhase
|
|||
return resolveWithPrereqs( work, includedGoals, results, context, pluginManager );
|
||||
}
|
||||
|
||||
private List resolveWithPrereqs( List work, Set includedGoals, List results, MavenLifecycleContext context, PluginManager pluginManager )
|
||||
private List resolveWithPrereqs( List work, Set includedGoals, List results, MavenGoalExecutionContext context, PluginManager pluginManager )
|
||||
{
|
||||
if ( !work.isEmpty() )
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ public class GoalResolutionPhase extends AbstractMavenLifecyclePhase
|
|||
return results;
|
||||
}
|
||||
|
||||
private List resolveGoalDecorators( List preGoals, Set includedGoals, List results, MavenLifecycleContext context, PluginManager pluginManager )
|
||||
private List resolveGoalDecorators( List preGoals, Set includedGoals, List results, MavenGoalExecutionContext context, PluginManager pluginManager )
|
||||
{
|
||||
for ( Iterator it = preGoals.iterator(); it.hasNext(); )
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
*/
|
||||
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
|
@ -26,7 +26,7 @@ import org.apache.maven.lifecycle.MavenLifecycleContext;
|
|||
public class InheritanceAssemblyPhase
|
||||
extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
*/
|
||||
|
||||
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.plugin.PluginManager;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
|
||||
|
@ -34,7 +34,7 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
|||
public class PluginDownloadPhase
|
||||
extends AbstractMavenLifecyclePhase
|
||||
{
|
||||
public void execute( MavenLifecycleContext context )
|
||||
public void execute( MavenGoalExecutionContext context )
|
||||
throws Exception
|
||||
{
|
||||
PluginManager pluginManager = (PluginManager) context.lookup( PluginManager.ROLE );
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.maven.plugin;
|
|||
|
||||
import ognl.Ognl;
|
||||
import ognl.OgnlException;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
|
|||
*/
|
||||
public class OgnlProjectValueExtractor
|
||||
{
|
||||
public static Object evaluate( String expression, MavenLifecycleContext context )
|
||||
public static Object evaluate( String expression, MavenGoalExecutionContext context )
|
||||
{
|
||||
Object value = null;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.maven.lifecycle.phase;
|
|||
import junit.framework.TestCase;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.decoration.GoalDecoratorBindings;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
@ -95,7 +95,7 @@ public class GoalDecorationPhaseTest extends TestCase
|
|||
|
||||
ArtifactRepository localRepository = new ArtifactRepository();
|
||||
|
||||
MavenLifecycleContext context = new MavenLifecycleContext( embedder.getContainer(),
|
||||
MavenGoalExecutionContext context = new MavenGoalExecutionContext( embedder.getContainer(),
|
||||
project,
|
||||
descriptor,
|
||||
localRepository );
|
||||
|
|
|
@ -5,7 +5,7 @@ import junit.framework.TestCase;
|
|||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.decoration.DefaultGoalDecorator;
|
||||
import org.apache.maven.decoration.GoalDecoratorBindings;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.plugin.PluginManager;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
|
@ -292,7 +292,7 @@ public class GoalResolutionPhaseTest extends TestCase
|
|||
|
||||
ArtifactRepository localRepository = new ArtifactRepository();
|
||||
|
||||
MavenLifecycleContext context = new MavenLifecycleContext( embedder.getContainer(),
|
||||
MavenGoalExecutionContext context = new MavenGoalExecutionContext( embedder.getContainer(),
|
||||
project,
|
||||
descriptor,
|
||||
localRepository );
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.apache.maven.plugin;
|
|||
|
||||
import org.apache.maven.MavenTestCase;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.lifecycle.MavenLifecycleContext;
|
||||
import org.apache.maven.lifecycle.MavenGoalExecutionContext;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.MavenProjectBuilder;
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class OgnlProjectValueExtractorTest
|
|||
|
||||
private MavenProjectBuilder builder;
|
||||
|
||||
private MavenLifecycleContext context;
|
||||
private MavenGoalExecutionContext context;
|
||||
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
|
@ -34,7 +34,7 @@ public class OgnlProjectValueExtractorTest
|
|||
|
||||
project.setProperty( "foo", "bar" );
|
||||
|
||||
context = new MavenLifecycleContext( getContainer(), project, null, new ArtifactRepository( "foo", "http://bar" ) );
|
||||
context = new MavenGoalExecutionContext( getContainer(), project, null, new ArtifactRepository( "foo", "http://bar" ) );
|
||||
}
|
||||
|
||||
public void testPropertyValueExtraction()
|
||||
|
|
Loading…
Reference in New Issue