Author: krosenvold
Date: Sun Apr 18 13:52:20 2010
New Revision: 935341
URL: http://svn.apache.org/viewvc?rev=935341&view=rev
Log:
o Refactoring: Extracted schedules out of DefaultLifecycles
Added:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java
(with props)
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java
(with props)
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java
(with props)
Modified:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorImpl.java
maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
Modified:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
(original)
+++
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
Sun Apr 18 13:52:20 2010
@@ -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>();
Added:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java?rev=935341&view=auto
==============================================================================
---
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java
(added)
+++
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java
Sun Apr 18 13:52:20 2010
@@ -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;
+ }
+}
\ No newline at end of file
Propchange:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultSchedules.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorImpl.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorImpl.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorImpl.java
(original)
+++
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorImpl.java
Sun Apr 18 13:52:20 2010
@@ -16,10 +16,21 @@ package org.apache.maven.lifecycle.inter
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.Xpp3
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
{
@@ -58,24 +78,29 @@ public class LifecycleExecutionPlanCalcu
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 LifecycleExecutionPlanCalcu
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 );
Modified:
maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++
maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
Sun Apr 18 13:52:20 2010
@@ -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>
Modified:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
(original)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java
Sun Apr 18 13:52:20 2010
@@ -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() );
-
- }
-
}
\ No newline at end of file
Added:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java?rev=935341&view=auto
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java
(added)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java
Sun Apr 18 13:52:20 2010
@@ -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() );
+
+ }
+}
\ No newline at end of file
Propchange:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultSchedulesTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java
(original)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java
Sun Apr 18 13:52:20 2010
@@ -20,6 +20,7 @@ import org.apache.maven.execution.MavenS
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 LifecycleExecutionPlanCalcu
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()
Modified:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java
(original)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java
Sun Apr 18 13:52:20 2010
@@ -34,7 +34,7 @@ import static org.apache.maven.lifecycle
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()
Added:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java?rev=935341&view=auto
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java
(added)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java
Sun Apr 18 13:52:20 2010
@@ -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 ) ) ) );
+ }
+}
\ No newline at end of file
Propchange:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultSchedulesStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
URL:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java?rev=935341&r1=935340&r2=935341&view=diff
==============================================================================
---
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
(original)
+++
maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
Sun Apr 18 13:52:20 2010
@@ -157,9 +157,9 @@ public class LifecycleExecutionPlanCalcu
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,