mirror of https://github.com/apache/maven.git
o Refactoring: Extracted schedules out of DefaultLifecycles
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@935341 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
69c68d06c5
commit
954acd1a12
|
@ -14,17 +14,6 @@
|
|||
*/
|
||||
package org.apache.maven.lifecycle;
|
||||
|
||||
import org.apache.maven.lifecycle.internal.BuilderCommon;
|
||||
import org.apache.maven.lifecycle.internal.ExecutionPlanItem;
|
||||
import org.apache.maven.plugin.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoNotFoundException;
|
||||
import org.apache.maven.plugin.PluginDescriptorParsingException;
|
||||
import org.apache.maven.plugin.PluginNotFoundException;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
|
||||
import org.apache.maven.plugin.version.PluginVersionResolutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
|
@ -53,69 +42,18 @@ public class DefaultLifecycles
|
|||
|
||||
private Logger logger;
|
||||
|
||||
private List<Scheduling> schedules;
|
||||
|
||||
@SuppressWarnings( { "UnusedDeclaration" } )
|
||||
public DefaultLifecycles()
|
||||
{
|
||||
}
|
||||
|
||||
public DefaultLifecycles( Map<String, Lifecycle> lifecycles, List<Scheduling> schedules, Logger logger )
|
||||
public DefaultLifecycles( Map<String, Lifecycle> lifecycles, Logger logger )
|
||||
{
|
||||
this.lifecycles = new LinkedHashMap<String, Lifecycle>();
|
||||
this.schedules = schedules;
|
||||
this.logger = logger;
|
||||
this.lifecycles = lifecycles;
|
||||
}
|
||||
|
||||
public List<ExecutionPlanItem> createExecutionPlanItem( MavenProject mavenProject, List<MojoExecution> executions )
|
||||
throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
|
||||
PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
|
||||
NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException
|
||||
{
|
||||
BuilderCommon.attachToThread( mavenProject );
|
||||
|
||||
List<ExecutionPlanItem> result = new ArrayList<ExecutionPlanItem>();
|
||||
for ( MojoExecution mojoExecution : executions )
|
||||
{
|
||||
String lifeCyclePhase = mojoExecution.getMojoDescriptor().getPhase();
|
||||
final Scheduling scheduling = getScheduling( "default" );
|
||||
Schedule schedule = null;
|
||||
if ( scheduling != null )
|
||||
{
|
||||
schedule = scheduling.getSchedule( mojoExecution.getPlugin() );
|
||||
if ( schedule == null )
|
||||
{
|
||||
schedule = scheduling.getSchedule( lifeCyclePhase );
|
||||
}
|
||||
}
|
||||
result.add( new ExecutionPlanItem( mojoExecution, schedule ) );
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets scheduling associated with a given phase.
|
||||
* <p/>
|
||||
* This is part of the experimental weave mode and therefore not part of the public api.
|
||||
*
|
||||
* @param lifecyclePhaseName The name of the lifecycle phase
|
||||
* @return Schecduling information related to phase
|
||||
*/
|
||||
|
||||
private Scheduling getScheduling( String lifecyclePhaseName )
|
||||
{
|
||||
for ( Scheduling schedule : schedules )
|
||||
{
|
||||
if ( lifecyclePhaseName.equals( schedule.getLifecycle() ) )
|
||||
{
|
||||
return schedule;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Lifecycle get( String key )
|
||||
{
|
||||
return getPhaseToLifecycleMap().get( key );
|
||||
|
@ -124,7 +62,7 @@ public class DefaultLifecycles
|
|||
/**
|
||||
* We use this to map all phases to the lifecycle that contains it. This is used so that a user can specify the
|
||||
* phase they want to execute and we can easily determine what lifecycle we need to run.
|
||||
*
|
||||
*
|
||||
* @return A map of lifecycles, indexed on id
|
||||
*/
|
||||
public Map<String, Lifecycle> getPhaseToLifecycleMap()
|
||||
|
@ -178,11 +116,6 @@ public class DefaultLifecycles
|
|||
return result;
|
||||
}
|
||||
|
||||
public List<Scheduling> getSchedules()
|
||||
{
|
||||
return schedules;
|
||||
}
|
||||
|
||||
public String getLifecyclePhaseList()
|
||||
{
|
||||
Set<String> phases = new LinkedHashSet<String>();
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
package org.apache.maven.lifecycle;
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.lifecycle.internal.BuilderCommon;
|
||||
import org.apache.maven.lifecycle.internal.ExecutionPlanItem;
|
||||
import org.apache.maven.plugin.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoNotFoundException;
|
||||
import org.apache.maven.plugin.PluginDescriptorParsingException;
|
||||
import org.apache.maven.plugin.PluginNotFoundException;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
|
||||
import org.apache.maven.plugin.version.PluginVersionResolutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Defines scheduling information needed by weave mode.
|
||||
*
|
||||
* @author Kristian Rosenvold
|
||||
*/
|
||||
|
||||
|
||||
public class DefaultSchedules
|
||||
{
|
||||
List<Scheduling> schedules;
|
||||
|
||||
@SuppressWarnings( { "UnusedDeclaration" } )
|
||||
public DefaultSchedules()
|
||||
{
|
||||
}
|
||||
|
||||
public DefaultSchedules( List<Scheduling> schedules )
|
||||
{
|
||||
this.schedules = schedules;
|
||||
}
|
||||
|
||||
public List<ExecutionPlanItem> createExecutionPlanItem( MavenProject mavenProject, List<MojoExecution> executions )
|
||||
throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
|
||||
PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
|
||||
NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException
|
||||
{
|
||||
BuilderCommon.attachToThread( mavenProject );
|
||||
|
||||
List<ExecutionPlanItem> result = new ArrayList<ExecutionPlanItem>();
|
||||
for ( MojoExecution mojoExecution : executions )
|
||||
{
|
||||
String lifeCyclePhase = mojoExecution.getMojoDescriptor().getPhase();
|
||||
final Scheduling scheduling = getScheduling( "default" );
|
||||
Schedule schedule = null;
|
||||
if ( scheduling != null )
|
||||
{
|
||||
schedule = scheduling.getSchedule( mojoExecution.getPlugin() );
|
||||
if ( schedule == null )
|
||||
{
|
||||
schedule = scheduling.getSchedule( lifeCyclePhase );
|
||||
}
|
||||
}
|
||||
result.add( new ExecutionPlanItem( mojoExecution, schedule ) );
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets scheduling associated with a given phase.
|
||||
* <p/>
|
||||
* This is part of the experimental weave mode and therefore not part of the public api.
|
||||
*
|
||||
* @param lifecyclePhaseName The name of the lifecycle phase
|
||||
* @return Schecduling information related to phase
|
||||
*/
|
||||
|
||||
Scheduling getScheduling( String lifecyclePhaseName )
|
||||
{
|
||||
for ( Scheduling schedule : schedules )
|
||||
{
|
||||
if ( lifecyclePhaseName.equals( schedule.getLifecycle() ) )
|
||||
{
|
||||
return schedule;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Scheduling> getSchedules()
|
||||
{
|
||||
return schedules;
|
||||
}
|
||||
}
|
|
@ -16,10 +16,21 @@ package org.apache.maven.lifecycle.internal;
|
|||
|
||||
import org.apache.maven.artifact.repository.DefaultRepositoryRequest;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.lifecycle.*;
|
||||
import org.apache.maven.lifecycle.DefaultLifecycles;
|
||||
import org.apache.maven.lifecycle.DefaultSchedules;
|
||||
import org.apache.maven.lifecycle.Lifecycle;
|
||||
import org.apache.maven.lifecycle.LifecycleNotFoundException;
|
||||
import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
|
||||
import org.apache.maven.lifecycle.MavenExecutionPlan;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.PluginExecution;
|
||||
import org.apache.maven.plugin.*;
|
||||
import org.apache.maven.plugin.BuildPluginManager;
|
||||
import org.apache.maven.plugin.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoNotFoundException;
|
||||
import org.apache.maven.plugin.PluginDescriptorParsingException;
|
||||
import org.apache.maven.plugin.PluginNotFoundException;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.Parameter;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
|
@ -36,7 +47,16 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
|
|||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -44,7 +64,7 @@ import java.util.*;
|
|||
* <p/>
|
||||
* NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
|
||||
*/
|
||||
@Component(role = LifecycleExecutionPlanCalculator.class)
|
||||
@Component( role = LifecycleExecutionPlanCalculator.class )
|
||||
public class LifecycleExecutionPlanCalculatorImpl
|
||||
implements LifecycleExecutionPlanCalculator
|
||||
{
|
||||
|
@ -57,25 +77,30 @@ public class LifecycleExecutionPlanCalculatorImpl
|
|||
@Requirement
|
||||
private DefaultLifecycles defaultLifeCycles;
|
||||
|
||||
@Requirement
|
||||
private DefaultSchedules defaultSchedules;
|
||||
|
||||
@Requirement
|
||||
private MojoDescriptorCreator mojoDescriptorCreator;
|
||||
|
||||
@Requirement
|
||||
private LifecyclePluginResolver lifecyclePluginResolver;
|
||||
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
@SuppressWarnings( { "UnusedDeclaration" } )
|
||||
public LifecycleExecutionPlanCalculatorImpl()
|
||||
{
|
||||
}
|
||||
|
||||
public LifecycleExecutionPlanCalculatorImpl( BuildPluginManager pluginManager, DefaultLifecycles defaultLifeCycles,
|
||||
MojoDescriptorCreator mojoDescriptorCreator,
|
||||
LifecyclePluginResolver lifecyclePluginResolver )
|
||||
LifecyclePluginResolver lifecyclePluginResolver,
|
||||
DefaultSchedules defaultSchedules )
|
||||
{
|
||||
this.pluginManager = pluginManager;
|
||||
this.defaultLifeCycles = defaultLifeCycles;
|
||||
this.mojoDescriptorCreator = mojoDescriptorCreator;
|
||||
this.lifecyclePluginResolver = lifecyclePluginResolver;
|
||||
this.defaultSchedules = defaultSchedules;
|
||||
}
|
||||
|
||||
public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks )
|
||||
|
@ -93,7 +118,7 @@ public class LifecycleExecutionPlanCalculatorImpl
|
|||
setupMojoExections( session, project, requiredDependencyResolutionScopes, requiredDependencyCollectionScopes,
|
||||
executions );
|
||||
|
||||
final List<ExecutionPlanItem> planItem = defaultLifeCycles.createExecutionPlanItem( project, executions );
|
||||
final List<ExecutionPlanItem> planItem = defaultSchedules.createExecutionPlanItem( project, executions );
|
||||
|
||||
return new MavenExecutionPlan( requiredDependencyResolutionScopes, requiredDependencyCollectionScopes, planItem,
|
||||
defaultLifeCycles );
|
||||
|
|
|
@ -22,37 +22,6 @@
|
|||
<implementation>org.apache.maven.plugin.MavenPluginCollector
|
||||
</implementation>
|
||||
</component>
|
||||
<!-- component>
|
||||
<role>org.apache.maven.lifecycle.LifecycleExecutor</role>
|
||||
<implementation>org.apache.maven.lifecycle.DefaultLifecycleExecutor
|
||||
</implementation>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.LifeCyclePluginAnalyzer</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.DefaultLifecycles</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.logging.Logger</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>logger</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.internal.LifecycleModuleBuilder</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.internal.LifecycleWeaveBuilder</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.internal.BuildListCalculator</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.lifecycle.internal.LifecycleDebugLogger</role>
|
||||
</requirement>
|
||||
</requirements>
|
||||
|
||||
</component -->
|
||||
<component>
|
||||
<role>org.apache.maven.lifecycle.DefaultLifecycles</role>
|
||||
<implementation>org.apache.maven.lifecycle.DefaultLifecycles</implementation>
|
||||
|
@ -67,30 +36,30 @@
|
|||
<field-name>lifecycles</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
|
||||
<configuration>
|
||||
<schedules>
|
||||
<scheduling>
|
||||
<lifecycle>default</lifecycle>
|
||||
<schedules>
|
||||
<schedule>
|
||||
<phase>test</phase>
|
||||
<mojoSynchronized>false</mojoSynchronized>
|
||||
<parallel>true</parallel>
|
||||
</schedule>
|
||||
<schedule>
|
||||
<mojoClass>org.apache.maven.plugins:maven-assembly-plugin</mojoClass>
|
||||
<mojoSynchronized>true</mojoSynchronized>
|
||||
</schedule>
|
||||
<!--schedule>
|
||||
<mojoClass>org.codehaus.modello:modello-maven-plugin</mojoClass>
|
||||
<mojoSynchronized>true</mojoSynchronized>
|
||||
</schedule -->
|
||||
</schedules>
|
||||
</scheduling>
|
||||
</schedules>
|
||||
</configuration>
|
||||
</component>
|
||||
<component>
|
||||
<role>org.apache.maven.lifecycle.DefaultSchedules</role>
|
||||
<implementation>org.apache.maven.lifecycle.DefaultSchedules</implementation>
|
||||
|
||||
<configuration>
|
||||
<schedules>
|
||||
<scheduling>
|
||||
<lifecycle>default</lifecycle>
|
||||
<schedules>
|
||||
<schedule>
|
||||
<phase>test</phase>
|
||||
<mojoSynchronized>false</mojoSynchronized>
|
||||
<parallel>true</parallel>
|
||||
</schedule>
|
||||
<schedule>
|
||||
<mojoClass>org.apache.maven.plugins:maven-assembly-plugin</mojoClass>
|
||||
<mojoSynchronized>true</mojoSynchronized>
|
||||
</schedule>
|
||||
</schedules>
|
||||
</scheduling>
|
||||
</schedules>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<role>org.apache.maven.lifecycle.Lifecycle</role>
|
||||
|
|
|
@ -56,21 +56,4 @@ public class DefaultLifecyclesTest
|
|||
|
||||
}
|
||||
|
||||
public void testScheduling()
|
||||
throws Exception
|
||||
{
|
||||
final List<Scheduling> schedulings = defaultLifeCycles.getSchedules();
|
||||
assertNotNull( schedulings );
|
||||
assertTrue( schedulings.size() > 0 );
|
||||
Scheduling first = schedulings.get( 0 );
|
||||
assertNotNull( first.getLifecycle() );
|
||||
final List<Schedule> schedules = first.getSchedules();
|
||||
assertNotNull( schedules );
|
||||
// Ok so if we ever change the first schedule this test will have to change
|
||||
Schedule firstSchedule = schedules.get( 0 );
|
||||
assertEquals( "test", firstSchedule.getPhase() );
|
||||
assertTrue( "Should be parllel", firstSchedule.isParallel() );
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.apache.maven.lifecycle;
|
||||
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DefaultSchedulesTest
|
||||
extends PlexusTestCase
|
||||
|
||||
{
|
||||
@Requirement
|
||||
DefaultSchedules defaultSchedules;
|
||||
|
||||
public DefaultSchedulesTest()
|
||||
{
|
||||
}
|
||||
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
defaultSchedules = ( lookup( DefaultSchedules.class ) );
|
||||
}
|
||||
|
||||
public void testScheduling()
|
||||
throws Exception
|
||||
{
|
||||
final List<Scheduling> schedulings = defaultSchedules.getSchedules();
|
||||
DefaultLifecyclesTest.assertNotNull( schedulings );
|
||||
DefaultLifecyclesTest.assertTrue( schedulings.size() > 0 );
|
||||
Scheduling first = schedulings.get( 0 );
|
||||
DefaultLifecyclesTest.assertNotNull( first.getLifecycle() );
|
||||
final List<Schedule> schedules = first.getSchedules();
|
||||
DefaultLifecyclesTest.assertNotNull( schedules );
|
||||
// Ok so if we ever change the first schedule this test will have to change
|
||||
Schedule firstSchedule = schedules.get( 0 );
|
||||
DefaultLifecyclesTest.assertEquals( "test", firstSchedule.getPhase() );
|
||||
DefaultLifecyclesTest.assertTrue( "Should be parllel", firstSchedule.isParallel() );
|
||||
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ import org.apache.maven.execution.MavenSession;
|
|||
import org.apache.maven.lifecycle.MavenExecutionPlan;
|
||||
import org.apache.maven.lifecycle.internal.stub.BuildPluginManagerStub;
|
||||
import org.apache.maven.lifecycle.internal.stub.DefaultLifecyclesStub;
|
||||
import org.apache.maven.lifecycle.internal.stub.DefaultSchedulesStub;
|
||||
import org.apache.maven.lifecycle.internal.stub.PluginPrefixResolverStub;
|
||||
import org.apache.maven.lifecycle.internal.stub.PluginVersionResolverStub;
|
||||
import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub;
|
||||
|
@ -65,8 +66,9 @@ public class LifecycleExecutionPlanCalculatorTest
|
|||
LifecyclePluginResolver lifecyclePluginResolver =
|
||||
new LifecyclePluginResolver( new PluginVersionResolverStub() );
|
||||
return new LifecycleExecutionPlanCalculatorImpl( new BuildPluginManagerStub(),
|
||||
DefaultLifecyclesStub.createDefaultLifeCycles(),
|
||||
mojoDescriptorCreator, lifecyclePluginResolver );
|
||||
DefaultLifecyclesStub.createDefaultLifecycles(),
|
||||
mojoDescriptorCreator, lifecyclePluginResolver,
|
||||
DefaultSchedulesStub.createDefaultSchedules());
|
||||
}
|
||||
|
||||
public static MojoDescriptorCreator createMojoDescriptorCreator()
|
||||
|
|
|
@ -34,7 +34,7 @@ import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCal
|
|||
|
||||
public class DefaultLifecyclesStub
|
||||
{
|
||||
public static DefaultLifecycles createDefaultLifeCycles()
|
||||
public static DefaultLifecycles createDefaultLifecycles()
|
||||
{
|
||||
|
||||
List<String> stubDefaultCycle =
|
||||
|
@ -44,11 +44,10 @@ public class DefaultLifecyclesStub
|
|||
|
||||
// The two phases below are really for future expansion, some would say they lack a drink
|
||||
// The point being that they do not really have to match the "real" stuff,
|
||||
List<String> stubCleanCycle =
|
||||
Arrays.asList( PRE_CLEAN.getPhase(), CLEAN.getPhase(), POST_CLEAN.getPhase() );
|
||||
List<String> stubCleanCycle = Arrays.asList( PRE_CLEAN.getPhase(), CLEAN.getPhase(), POST_CLEAN.getPhase() );
|
||||
|
||||
List<String> stubSiteCycle =
|
||||
Arrays.asList( PRE_SITE.getPhase(), SITE.getPhase(), POST_SITE.getPhase(), SITE_DEPLOY.getPhase());
|
||||
Arrays.asList( PRE_SITE.getPhase(), SITE.getPhase(), POST_SITE.getPhase(), SITE_DEPLOY.getPhase() );
|
||||
|
||||
Iterator<List<String>> lcs = Arrays.asList( stubDefaultCycle, stubCleanCycle, stubSiteCycle ).iterator();
|
||||
|
||||
|
@ -59,8 +58,7 @@ public class DefaultLifecyclesStub
|
|||
lifeCycles.put( s, lifecycle );
|
||||
|
||||
}
|
||||
final List<Scheduling> schedulingList = getSchedulingList();
|
||||
return new DefaultLifecycles( lifeCycles, schedulingList, new LoggerStub() );
|
||||
return new DefaultLifecycles( lifeCycles, new LoggerStub() );
|
||||
}
|
||||
|
||||
public static List<Scheduling> getSchedulingList()
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
package org.apache.maven.lifecycle.internal.stub;
|
||||
|
||||
import org.apache.maven.lifecycle.DefaultSchedules;
|
||||
import org.apache.maven.lifecycle.Schedule;
|
||||
import org.apache.maven.lifecycle.Scheduling;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Kristian Rosenvold
|
||||
*/
|
||||
|
||||
public class DefaultSchedulesStub
|
||||
{
|
||||
public static DefaultSchedules createDefaultSchedules()
|
||||
{
|
||||
return new DefaultSchedules( getSchedulingList() );
|
||||
}
|
||||
|
||||
public static List<Scheduling> getSchedulingList()
|
||||
{
|
||||
return Arrays.asList( new Scheduling( "default", Arrays.asList( new Schedule( "compile", false, false ),
|
||||
new Schedule( "test", false, true ) ) ) );
|
||||
}
|
||||
}
|
|
@ -157,9 +157,9 @@ public class LifecycleExecutionPlanCalculatorStub
|
|||
LifecyclePhaseNotFoundException, LifecycleNotFoundException
|
||||
{
|
||||
final List<ExecutionPlanItem> planItemList =
|
||||
DefaultLifecyclesStub.createDefaultLifeCycles().createExecutionPlanItem( project, mojoExecutions );
|
||||
DefaultSchedulesStub.createDefaultSchedules().createExecutionPlanItem( project, mojoExecutions );
|
||||
return new MavenExecutionPlan( getScopes(), getScopes(), planItemList,
|
||||
DefaultLifecyclesStub.createDefaultLifeCycles() );
|
||||
DefaultLifecyclesStub.createDefaultLifecycles() );
|
||||
}
|
||||
|
||||
private static MojoExecution createMojoExecution( Plugin plugin, String goal, String executionId,
|
||||
|
|
Loading…
Reference in New Issue