diff options
author | Igor Fedorenko | 2011-02-05 05:05:29 +0000 |
---|---|---|
committer | Igor Fedorenko | 2011-02-05 05:05:29 +0000 |
commit | d132f15df7ad0e0d6f475e331bcc07bdcbb3070f (patch) | |
tree | b5a961d33849bd742b259042f7f68f680ad96f8b /org.eclipse.m2e.tests.common | |
parent | 358d9f4bb2112142a8f20fa74c56cb7cde611e1a (diff) | |
download | m2e-core-d132f15df7ad0e0d6f475e331bcc07bdcbb3070f.tar.gz m2e-core-d132f15df7ad0e0d6f475e331bcc07bdcbb3070f.tar.xz m2e-core-d132f15df7ad0e0d6f475e331bcc07bdcbb3070f.zip |
336410: Allow mapping of mojo executions from non-default lifecycles
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.tests.common')
-rw-r--r-- | org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java index f327acb0..128e23ff 100644 --- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java +++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -29,7 +30,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenSession; -import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; import org.eclipse.m2e.core.MavenPlugin; @@ -38,6 +39,7 @@ import org.eclipse.m2e.core.internal.lifecycle.model.LifecycleMappingMetadataSou import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionMetadata; import org.eclipse.m2e.core.internal.lifecycle.model.io.xpp3.LifecycleMappingMetadataSourceXpp3Reader; import org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade; +import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager; import org.eclipse.m2e.core.project.IMavenProjectFacade; import org.eclipse.m2e.core.project.IProjectConfigurationManager; import org.eclipse.m2e.core.project.MavenProjectManager; @@ -96,10 +98,17 @@ public abstract class AbstractLifecycleMappingTest extends AbstractMavenProjectT MavenProject mavenProject = plugin.getMaven().readProject(pom.getLocation().toFile(), monitor); MavenExecutionRequest request = plugin.getMaven().createExecutionRequest(monitor); MavenSession session = plugin.getMaven().createSession(request, mavenProject); - MavenExecutionPlan executionPlan = plugin.getMaven().calculateExecutionPlan(session, mavenProject, - Arrays.asList("deploy"), false, monitor); + Map<String, List<MojoExecution>> executionPlans = new LinkedHashMap<String, List<MojoExecution>>(); + executionPlans.put(ProjectRegistryManager.LIFECYCLE_CLEAN, new ArrayList<MojoExecution>()); + executionPlans.put( + ProjectRegistryManager.LIFECYCLE_DEFAULT, + plugin + .getMaven() + .calculateExecutionPlan(session, mavenProject, Arrays.asList(ProjectRegistryManager.LIFECYCLE_DEFAULT), + false, monitor).getMojoExecutions()); + executionPlans.put(ProjectRegistryManager.LIFECYCLE_SITE, new ArrayList<MojoExecution>()); MavenProjectFacade facade = new MavenProjectFacade(plugin.getMavenProjectManagerImpl(), pom, mavenProject, - executionPlan.getMojoExecutions(), new ResolverConfiguration()); + executionPlans, new ResolverConfiguration()); return facade; } |