You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ke...@apache.org on 2005/09/26 20:17:28 UTC

svn commit: r291699 - in /maven/components/trunk/sandbox/maven-it-plugin: maven-it-plugin-test/ maven-it-plugin-test/pom.xml maven-it-plugin-test/src/ src/main/java/org/apache/maven/plugin/it/ForkMojo.java

Author: kenney
Date: Mon Sep 26 11:17:19 2005
New Revision: 291699

URL: http://svn.apache.org/viewcvs?rev=291699&view=rev
Log:
o the it plugin now uses the DirectoryScanner for poms, and adds
  includes/excludes.

o Added a test project for the it plugin; it runs the integration tests.
  Doesn't work though - you only see 'Building XXX', but it doesn't build (?)

Added:
    maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/
    maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml   (with props)
    maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/src/
Modified:
    maven/components/trunk/sandbox/maven-it-plugin/src/main/java/org/apache/maven/plugin/it/ForkMojo.java

Added: maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml?rev=291699&view=auto
==============================================================================
--- maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml (added)
+++ maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml Mon Sep 26 11:17:19 2005
@@ -0,0 +1,52 @@
+<model
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven</groupId>
+  <artifactId>maven-it-plugin-test</artifactId>
+  <version>1.0-alpha-1-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-it-plugin</artifactId>
+        <configuration>
+          <integrationTestsDirectory>${basedir}/../../../maven-core-it</integrationTestsDirectory>
+					<includes>
+						<include>it0*/pom.xml</include>
+					</includes>
+					<excludes>
+						<exclude>it007*/pom.xml</exclude>
+						<exclude>it008*/pom.xml</exclude>
+					</excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<configuration>
+							<tasks>
+								<echo>Packaging maven-it-plugin-test</echo>
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+    </plugins>
+  </build>
+</model>

Propchange: maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/sandbox/maven-it-plugin/maven-it-plugin-test/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/components/trunk/sandbox/maven-it-plugin/src/main/java/org/apache/maven/plugin/it/ForkMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/maven-it-plugin/src/main/java/org/apache/maven/plugin/it/ForkMojo.java?rev=291699&r1=291698&r2=291699&view=diff
==============================================================================
--- maven/components/trunk/sandbox/maven-it-plugin/src/main/java/org/apache/maven/plugin/it/ForkMojo.java (original)
+++ maven/components/trunk/sandbox/maven-it-plugin/src/main/java/org/apache/maven/plugin/it/ForkMojo.java Mon Sep 26 11:17:19 2005
@@ -17,6 +17,7 @@
  */
 
 import java.io.File;
+import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -36,12 +37,11 @@
 import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
+import org.codehaus.plexus.util.DirectoryScanner;
 
 /**
  * @goal fork
  *
- * @execute phase="package"
- *
  * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
  */
 public class ForkMojo
@@ -72,6 +72,15 @@
      */
     private File integrationTestsDirectory;
 
+    /**
+     * @parameter
+     */
+    private String [] includes = new String[] { "*/pom.xml" };
+
+    /**
+     * @parameter
+     */
+    private String [] excludes = new String[0];
 
     public void execute()
         throws MojoExecutionException
@@ -168,6 +177,26 @@
 
     private List listITPoms()
     {
+		DirectoryScanner scanner = new DirectoryScanner();
+
+		scanner.setBasedir( integrationTestsDirectory );
+
+		scanner.setIncludes( includes );
+
+		scanner.setExcludes( excludes );
+
+		scanner.scan();
+		
+		List poms = new ArrayList();
+
+		for ( int i = 0; i < scanner.getIncludedFiles().length; i++ )
+		{
+			poms.add( new File( integrationTestsDirectory, scanner.getIncludedFiles()[i] ) );
+		}
+
+		return poms;
+
+		/*
         List poms = new ArrayList();
 
         File [] children = integrationTestsDirectory.listFiles();
@@ -186,5 +215,6 @@
         }
 
         return poms;
+		*/
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org