You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/08/12 22:20:57 UTC

svn commit: r685293 - in /maven: components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/ core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/ core-integration-testing/tr...

Author: jdcasey
Date: Tue Aug 12 13:20:56 2008
New Revision: 685293

URL: http://svn.apache.org/viewvc?rev=685293&view=rev
Log:
[MNG-3704] Accommodate external implementations that extend DefaultLifecycleExecutor, but which may not be up-to-date on the latest component requirements for that class...specifically the project builder and the model interpolator. Also includes an integration test.

Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3704LifecycleExecutorWrapperTest.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/pom.xml
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/MyMojo.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/TestLifecycleExecutor.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/components.xml
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/pom.xml
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/pom.xml
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/App.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/AppTest.java
Modified:
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java

Modified: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=685293&r1=685292&r2=685293&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Tue Aug 12 13:20:56 2008
@@ -59,11 +59,18 @@
 import org.apache.maven.project.interpolation.ModelInterpolator;
 import org.apache.maven.reporting.MavenReport;
 import org.apache.maven.settings.Settings;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.PlexusContainerException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.configuration.PlexusConfigurationException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
@@ -90,7 +97,7 @@
  */
 public class DefaultLifecycleExecutor
     extends AbstractLogEnabled
-    implements LifecycleExecutor
+    implements LifecycleExecutor, Initializable, Contextualizable
 {
     // ----------------------------------------------------------------------
     // Components
@@ -1877,4 +1884,58 @@
     {
         return lifecycles;
     }
+
+    // -------------------------------------------------------------------------
+    // TODO: The methods and fields below are only needed for products like Hudson,
+    //  that provide their own LifecycleExecutor and component configuration, 
+    //  which may not contain up-to-date component requirements.
+    public void initialize()
+        throws InitializationException
+    {
+        if ( mavenProjectBuilder == null )
+        {
+            warnOfIncompleteComponentConfiguration( MavenProjectBuilder.ROLE );
+            try
+            {
+                mavenProjectBuilder = (MavenProjectBuilder) container.lookup( MavenProjectBuilder.ROLE );
+            }
+            catch ( ComponentLookupException e )
+            {
+                throw new InitializationException( "Failed to lookup project builder after it was NOT injected via component requirement." );
+            }
+        }
+        
+        if ( modelInterpolator == null )
+        {
+            warnOfIncompleteComponentConfiguration( ModelInterpolator.ROLE );
+            try
+            {
+                modelInterpolator = (ModelInterpolator) container.lookup( ModelInterpolator.ROLE );
+            }
+            catch ( ComponentLookupException e )
+            {
+                throw new InitializationException( "Failed to lookup model interpolator after it was NOT injected via component requirement." );
+            }
+        }
+    }
+    
+    private void warnOfIncompleteComponentConfiguration( String role )
+    {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append( "\n************ WARNING ************" );
+        buffer.append( "\n\nThis Maven runtime contains a LifecycleExecutor component with an incomplete configuration." );
+        buffer.append( "\n\nLifecycleExecutor class: " ).append( getClass().getName() );
+        buffer.append( "\nMissing component requirement: " ).append( role );
+        buffer.append( "\n\n" );
+        
+        getLogger().warn( buffer.toString() );
+    }
+
+    private PlexusContainer container;
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+    }
 }

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?rev=685293&r1=685292&r2=685293&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java Tue Aug 12 13:20:56 2008
@@ -76,6 +76,7 @@
 MavenITmng3645POMSyntaxErrorTest
 */
 
+        suite.addTestSuite( MavenITmng3704LifecycleExecutorWrapperTest.class );
         suite.addTestSuite( MavenITmng3703ExecutionProjectWithRelativePathsTest.class );
         suite.addTestSuite( MavenITmng3694ReactorProjectsDynamismTest.class );
         suite.addTestSuite( MavenITmng3693PomFileBasedirChangeTest.class );

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3704LifecycleExecutorWrapperTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3704LifecycleExecutorWrapperTest.java?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3704LifecycleExecutorWrapperTest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3704LifecycleExecutorWrapperTest.java Tue Aug 12 13:20:56 2008
@@ -0,0 +1,68 @@
+/*
+ * 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.integrationtests;
+
+import java.io.File;
+
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3704">MNG-3704</a>.
+ *
+ * @todo Fill in a better description of what this test verifies!
+ * 
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @author jdcasey
+ * 
+ */
+public class MavenITmng3704LifecycleExecutorWrapperTest
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng3704LifecycleExecutorWrapperTest()
+        throws InvalidVersionSpecificationException
+    {
+        super( "(2.0.9,)" ); // only test in 2.0.9+
+    }
+
+    public void testitMNG3704 ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3704-lifecycleExecutorWrapper" );
+        File pluginDir = new File( testDir, "maven-mng3704-plugin" );
+        File projectDir = new File( testDir, "project" );
+
+        Verifier verifier;
+        verifier = new Verifier( pluginDir.getAbsolutePath() );
+
+        verifier.executeGoal( "install" );
+
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = new Verifier( projectDir.getAbsolutePath() );
+
+        verifier.executeGoal( "package" );
+
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+}

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/pom.xml?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/pom.xml Tue Aug 12 13:20:56 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3704</groupId>
+  <artifactId>maven-mng3704-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>maven-mng3704-plugin Maven Mojo</name>
+  <version>1</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.maven</groupId>
+    	<artifactId>maven-core</artifactId>
+    	<version>2.0.9</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/MyMojo.java?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/MyMojo.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/MyMojo.java Tue Aug 12 13:20:56 2008
@@ -0,0 +1,133 @@
+package org.apache.maven.lifecycle;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.BuildFailureException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.execution.ReactorManager;
+import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.lifecycle.LifecycleExecutor;
+import org.apache.maven.monitor.event.DefaultEventDispatcher;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.DefaultProjectBuilderConfiguration;
+import org.apache.maven.project.DuplicateProjectException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
+
+/**
+ * Tests that the lifecycle executor with the out-of-date component configuration (missing some new component
+ * requirements) will still work...
+ * 
+ * @goal run
+ * @phase validate
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+    /**
+     * @component role-hint="test"
+     */
+    private LifecycleExecutor lifecycleExecutor;
+
+    /**
+     * @parameter default-value="${session}"
+     * @required
+     * @readonly
+     */
+    private MavenSession session;
+
+    /**
+     * @component
+     */
+    private MavenProjectBuilder projectBuilder;
+
+    /**
+     * @parameter default-value="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( !( lifecycleExecutor instanceof TestLifecycleExecutor ) )
+        {
+            throw new MojoExecutionException( "Wrong LifecycleExecutor was injected into the mojo." );
+        }
+
+        MavenProject testProject;
+        try
+        {
+            testProject = projectBuilder.build( new File( project.getBasedir(), "test-project/pom.xml" ),
+                                  new DefaultProjectBuilderConfiguration() );
+        }
+        catch ( ProjectBuildingException e )
+        {
+            throw new MojoExecutionException( "Failed to build test project instance prior to lifecycle execution.", e );
+        }
+
+        List tasks = new ArrayList();
+        tasks.add( "compile" );
+        
+        ReactorManager rm;
+        try
+        {
+            rm = new ReactorManager( Collections.singletonList( testProject ) );
+        }
+        catch ( CycleDetectedException e )
+        {
+            throw new MojoExecutionException( "Failed to construct ReactorManager instance prior to lifecycle execution.", e );
+        }
+        catch ( DuplicateProjectException e )
+        {
+            throw new MojoExecutionException( "Failed to construct ReactorManager instance prior to lifecycle execution.", e );
+        }
+        
+        MavenSession s =
+            new MavenSession( session.getContainer(), session.getSettings(), session.getLocalRepository(),
+                              new DefaultEventDispatcher(), rm, tasks, session.getExecutionRootDirectory(),
+                              session.getExecutionProperties(), session.getStartTime() );
+
+        try
+        {
+            lifecycleExecutor.execute( s, rm, s.getEventDispatcher() );
+        }
+        catch ( LifecycleExecutionException e )
+        {
+            throw new MojoExecutionException( "Unexpected error: " + e.getMessage(), e );
+        }
+        catch ( BuildFailureException e )
+        {
+            throw new MojoExecutionException( "Unexpected error: " + e.getMessage(), e );
+        }
+        catch ( NullPointerException e )
+        {
+            throw new MojoExecutionException(
+                                              "Encountered a NullPointerException. Check that all component requirements have been met or managed through the initialization phase.",
+                                              e );
+        }
+    }
+}

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/TestLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/TestLifecycleExecutor.java?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/TestLifecycleExecutor.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/java/org/apache/maven/lifecycle/TestLifecycleExecutor.java Tue Aug 12 13:20:56 2008
@@ -0,0 +1,9 @@
+package org.apache.maven.lifecycle;
+
+import org.apache.maven.lifecycle.DefaultLifecycleExecutor;
+
+public class TestLifecycleExecutor
+    extends DefaultLifecycleExecutor
+{
+
+}

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/components.xml?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/maven-mng3704-plugin/src/main/resources/META-INF/plexus/components.xml Tue Aug 12 13:20:56 2008
@@ -0,0 +1,119 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.lifecycle.LifecycleExecutor</role>
+      <role-hint>test</role-hint>
+      <implementation>org.apache.maven.lifecycle.TestLifecycleExecutor</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.plugin.PluginManager</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.extension.ExtensionManager</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
+        </requirement>
+        <!--  These are missing BY DESIGN. They are new requirements, which means 
+              external implementations who extend the default will not have these
+              requirements. The executor should try to compensate, to remain as
+              compatible as possible.
+        <requirement>
+          <role>org.apache.maven.project.MavenProjectBuilder</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.project.interpolation.ModelInterpolator</role>
+        </requirement>
+        -->
+      </requirements>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <!-- START SNIPPET: lifecycle -->
+            <phases>
+              <phase>validate</phase>
+              <phase>initialize</phase>
+              <phase>generate-sources</phase>
+              <phase>process-sources</phase>
+              <phase>generate-resources</phase>
+              <phase>process-resources</phase>
+              <phase>compile</phase>
+              <phase>process-classes</phase>
+              <phase>generate-test-sources</phase>
+              <phase>process-test-sources</phase>
+              <phase>generate-test-resources</phase>
+              <phase>process-test-resources</phase>
+              <phase>test-compile</phase>
+              <phase>process-test-classes</phase>
+              <phase>test</phase>
+              <phase>package</phase>
+              <phase>pre-integration-test</phase>
+              <phase>integration-test</phase>
+              <phase>post-integration-test</phase>
+              <phase>verify</phase>
+              <phase>install</phase>
+              <phase>deploy</phase>
+            </phases>
+            <!-- END SNIPPET: lifecycle -->
+          </lifecycle>
+          <lifecycle>
+            <id>clean</id>
+            <phases>
+              <phase>pre-clean</phase>
+              <phase>clean</phase>
+              <phase>post-clean</phase>
+            </phases>
+            <default-phases>
+              <clean>org.apache.maven.plugins:maven-clean-plugin:clean</clean>
+            </default-phases>
+          </lifecycle>
+          <lifecycle>
+            <id>site</id>
+            <phases>
+              <phase>pre-site</phase>
+              <phase>site</phase>
+              <phase>post-site</phase>
+              <phase>site-deploy</phase>
+            </phases>
+            <default-phases>
+              <site>org.apache.maven.plugins:maven-site-plugin:site</site>
+              <site-deploy>org.apache.maven.plugins:maven-site-plugin:deploy</site-deploy>
+            </default-phases>
+          </lifecycle>
+        </lifecycles>
+        <!-- START SNIPPET: default-reports -->
+        <defaultReports>
+          <report>org.apache.maven.plugins:maven-project-info-reports-plugin</report>
+          <!-- TODO: currently in mojo - should they be defaults any more?
+          <report>org.apache.maven.plugins:maven-checkstyle-plugin</report>
+          <report>org.apache.maven.plugins:maven-javadoc-plugin</report>
+                    <report>org.apache.maven.plugins:maven-changelog-plugin</report>
+                    <report>org.apache.maven.plugins:maven-surefire-report-plugin</report>
+                    <report>org.apache.maven.plugins:maven-jdepend-plugin</report>
+                    <report>org.apache.maven.plugins:maven-jxr-plugin</report>
+                    <report>org.apache.maven.plugins:maven-taglist-plugin</report>
+          -->
+        </defaultReports>
+        <!-- END SNIPPET: default-reports -->
+        <!-- START SNIPPET: default-lifecycle -->
+        <!-- NOT USED, ACCORDING TO CODE.
+        <defaultPhases>
+          <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
+          <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
+          <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
+          <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
+          <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
+          <package>
+            org.apache.maven.plugins:maven-jar-plugin:jar,
+            org.apache.maven.plugins:maven-source-plugin:jar
+          </package>
+          <install>org.apache.maven.plugins:maven-install-plugin:install</install>
+          <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
+        </defaultPhases>
+        -->
+        <!-- END SNIPPET: default-lifecycle -->
+      </configuration>
+    </component>
+  </components>
+</component-set>
\ No newline at end of file

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/pom.xml?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/pom.xml Tue Aug 12 13:20:56 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3704</groupId>
+  <artifactId>project</artifactId>
+  <name>Test Launcher Project</name>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <url>http://maven.apache.org</url>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.mng3704</groupId>
+        <artifactId>maven-mng3704-plugin</artifactId>
+        <version>1</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/pom.xml?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/pom.xml Tue Aug 12 13:20:56 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3704</groupId>
+  <artifactId>test-project</artifactId>
+  <name>Test Project</name>
+  <version>1</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/App.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/App.java?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/App.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/main/java/jar/App.java Tue Aug 12 13:20:56 2008
@@ -0,0 +1,13 @@
+package jar;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/AppTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/AppTest.java?rev=685293&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/AppTest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3704-lifecycleExecutorWrapper/project/test-project/src/test/java/jar/AppTest.java Tue Aug 12 13:20:56 2008
@@ -0,0 +1,38 @@
+package jar;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}