mirror of https://github.com/apache/maven.git
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 (?) git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291699 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c6a140e1ae
commit
e1391f016b
|
@ -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>
|
|
@ -17,6 +17,7 @@ package org.apache.maven.plugin.it;
|
|||
*/
|
||||
|
||||
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.project.ProjectBuildingException;
|
|||
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 @@ public class ForkMojo
|
|||
*/
|
||||
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 @@ public class ForkMojo
|
|||
|
||||
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 @@ public class ForkMojo
|
|||
}
|
||||
|
||||
return poms;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue