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 2007/01/30 22:37:51 UTC
svn commit: r501581 - in /maven/sandbox/plugins/maven-component-it-plugin:
./ pom.xml src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java
src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java
Author: jdcasey
Date: Tue Jan 30 13:37:50 2007
New Revision: 501581
URL: http://svn.apache.org/viewvc?view=rev&rev=501581
Log:
Renaming to maven-component-it-plugin, since it can be used to integration-test most any maven component (think build extensions in addition to plugins), and fixing the stage mojo to pass in the current project's POM file rather than having the tools guess using new File( ".", "pom.xml" ), which leads to problems in multimodule builds.
Added:
maven/sandbox/plugins/maven-component-it-plugin/
- copied from r489138, maven/sandbox/plugins/maven-plug-it-plugin/
Modified:
maven/sandbox/plugins/maven-component-it-plugin/pom.xml
maven/sandbox/plugins/maven-component-it-plugin/src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java
maven/sandbox/plugins/maven-component-it-plugin/src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java
Modified: maven/sandbox/plugins/maven-component-it-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-component-it-plugin/pom.xml?view=diff&rev=501581&r1=489138&r2=501581
==============================================================================
--- maven/sandbox/plugins/maven-component-it-plugin/pom.xml (original)
+++ maven/sandbox/plugins/maven-component-it-plugin/pom.xml Tue Jan 30 13:37:50 2007
@@ -7,8 +7,8 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plug-it-plugin</artifactId>
- <name>Maven Plugin-IT Plugin</name>
+ <artifactId>maven-component-it-plugin</artifactId>
+ <name>Maven-Component Integration-Testing Plugin</name>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
@@ -16,7 +16,7 @@
<maven>2.0</maven>
</prerequisites>
- <url>http://maven.apache.org/plugins/maven-plug-it-plugin</url>
+ <url>http://maven.apache.org/plugins/maven-component-it-plugin</url>
<dependencies>
<dependency>
@@ -41,6 +41,11 @@
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-velocity</artifactId>
<version>1.1.2</version>
</dependency>
@@ -52,7 +57,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-test-tools</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0-alpha-2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Modified: maven/sandbox/plugins/maven-component-it-plugin/src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-component-it-plugin/src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java?view=diff&rev=501581&r1=489138&r2=501581
==============================================================================
--- maven/sandbox/plugins/maven-component-it-plugin/src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java (original)
+++ maven/sandbox/plugins/maven-component-it-plugin/src/main/java/org/apache/maven/plugin/plugit/StagePluginMojo.java Tue Jan 30 13:37:50 2007
@@ -3,6 +3,7 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.shared.test.plugin.ComponentTestTool;
import org.apache.maven.shared.test.plugin.PluginTestTool;
import org.apache.maven.shared.test.plugin.TestToolsException;
@@ -50,25 +51,35 @@
private File repositoryDirectory;
/**
- * Component that orchestrates the plugin staging. This plugin is really just a wrapper around
- * the PluginTestTool.
+ * The POM file.
*
- * @component
+ * @parameter default-value="${project.file}"
+ * @required
+ * @readonly
*/
- private PluginTestTool pluginTestTool;
+ private File pomFile;
+ /**
+ * Component that orchestrates staging. This plugin is really just a wrapper around
+ * the ComponentTestTool.
+ *
+ * @component
+ */
+ private ComponentTestTool componentTestTool;
+
public StagePluginMojo()
{
// used by Maven
}
- StagePluginMojo( boolean skipUnitTests, String pluginVersion, File repositoryDirectory,
- PluginTestTool pluginTestTool )
+ StagePluginMojo( File pomFile, boolean skipUnitTests, String pluginVersion, File repositoryDirectory,
+ ComponentTestTool componentTestTool )
{
+ this.pomFile = pomFile;
this.skipUnitTests = skipUnitTests;
this.pluginVersion = pluginVersion;
this.repositoryDirectory = repositoryDirectory;
- this.pluginTestTool = pluginTestTool;
+ this.componentTestTool = componentTestTool;
}
public void execute()
@@ -78,11 +89,11 @@
{
if ( skipUnitTests )
{
- pluginTestTool.preparePluginForUnitTestingWithMavenBuilds( pluginVersion, repositoryDirectory );
+ componentTestTool.prepareComponentForUnitTestingWithMavenBuilds( pomFile, pluginVersion, repositoryDirectory );
}
else
{
- pluginTestTool.preparePluginForIntegrationTesting( pluginVersion, repositoryDirectory );
+ componentTestTool.prepareComponentForIntegrationTesting( pomFile, pluginVersion, repositoryDirectory );
}
}
catch ( TestToolsException e )
Modified: maven/sandbox/plugins/maven-component-it-plugin/src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-component-it-plugin/src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java?view=diff&rev=501581&r1=489138&r2=501581
==============================================================================
--- maven/sandbox/plugins/maven-component-it-plugin/src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java (original)
+++ maven/sandbox/plugins/maven-component-it-plugin/src/test/java/org/apache/maven/plugin/plugit/StagePluginMojoTest.java Tue Jan 30 13:37:50 2007
@@ -2,17 +2,18 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.shared.test.plugin.PluginTestTool;
+import org.apache.maven.shared.test.plugin.ComponentTestTool;
import org.apache.maven.shared.tools.easymock.TestFileManager;
import org.codehaus.plexus.PlexusTestCase;
import java.io.File;
+import java.io.IOException;
public class StagePluginMojoTest
extends PlexusTestCase
{
- private PluginTestTool pluginTestTool;
+ private ComponentTestTool componentTestTool;
private TestFileManager fileManager = new TestFileManager( "StagePluginMojo.test", "" );
@@ -20,7 +21,7 @@
{
super.setUp();
- this.pluginTestTool = (PluginTestTool) lookup( PluginTestTool.ROLE, "default" );
+ this.componentTestTool = (ComponentTestTool) lookup( ComponentTestTool.ROLE, "default" );
}
public void tearDown() throws Exception
@@ -31,7 +32,7 @@
}
public void testShouldInstallThisPluginToSpecifiedTestLocalRepoLocation()
- throws MojoExecutionException, MojoFailureException
+ throws MojoExecutionException, MojoFailureException, IOException
{
File localRepoParent = fileManager.createTempDir();
File localRepo = new File( localRepoParent, "local-repository" );
@@ -39,7 +40,7 @@
assertFalse( localRepo.exists() );
// we must ALWAYS skip unit tests for this unit test...
- new StagePluginMojo( true, "testing", localRepo, pluginTestTool ).execute();
+ new StagePluginMojo( new File( "pom.xml" ).getCanonicalFile(), true, "testing", localRepo, componentTestTool ).execute();
assertTrue( localRepo.exists() );
}