You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by st...@apache.org on 2011/03/25 13:11:01 UTC
svn commit: r1085344 - in /maven/ant-tasks/trunk/src/it/pom-generation: ./
build.xml invoker.properties pom.xml verify.bsh
Author: stephenc
Date: Fri Mar 25 12:11:01 2011
New Revision: 1085344
URL: http://svn.apache.org/viewvc?rev=1085344&view=rev
Log:
adding test case for MANTTASKS-217
Added:
maven/ant-tasks/trunk/src/it/pom-generation/
maven/ant-tasks/trunk/src/it/pom-generation/build.xml
maven/ant-tasks/trunk/src/it/pom-generation/invoker.properties
maven/ant-tasks/trunk/src/it/pom-generation/pom.xml
maven/ant-tasks/trunk/src/it/pom-generation/verify.bsh
Added: maven/ant-tasks/trunk/src/it/pom-generation/build.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/it/pom-generation/build.xml?rev=1085344&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/it/pom-generation/build.xml (added)
+++ maven/ant-tasks/trunk/src/it/pom-generation/build.xml Fri Mar 25 12:11:01 2011
@@ -0,0 +1,41 @@
+<project name="maven-ant-tasks" default="test" xmlns:artifact="urn:maven-artifact-ant" xmlns:test="urn:test-tasks">
+
+ <target name="initTaskDefs">
+ <xmlproperty file="../../../pom.xml" prefix="pom.xml" />
+
+ <path id="maven-ant-tasks.classpath" path="../../maven-ant-tasks-${pom.xml.project.version}.jar" />
+ <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
+ classpathref="maven-ant-tasks.classpath"/>
+ </target>
+
+
+ <target name="test" depends="initTaskDefs">
+
+ <artifact:pom id="parent-pom" groupId="local.maven-ant-tasks" artifactId="pom-generation-parent" version="1.0-SNAPSHOT">
+ <license name="apache" url="http://www.apache.org"/>
+ <dependencyManagement>
+ <dependency groupId="junit" artifactId="junit" version="4.1"/>
+ <dependency groupId="org.codehaus.plexus" artifactId="plexus-utils" version="1.5.5"/>
+ </dependencyManagement>
+ </artifact:pom>
+
+ <artifact:pom id="child-pom" artifactId="pom-generation-child">
+ <parent groupId="local.maven-ant-tasks" artifactId="pom-generation-parent" version="1.0-SNAPSHOT"/>
+ <dependency groupId="junit" artifactId="junit" scope="test"/>
+ <dependency groupId="org.codehaus.plexus" artifactId="plexus-utils"/>
+ </artifact:pom>
+
+ <mkdir dir="target"/>
+
+ <artifact:writepom pomRefId="parent-pom" file="target/parent-pom.xml"/>
+ <artifact:writepom pomRefId="child-pom" file="target/child-pom.xml"/>
+
+ <artifact:dependencies fileSetId="mydeps" pomRefId="child-pom"/>
+
+ <copy todir="target">
+ <fileset refid="mydeps"/>
+ </copy>
+
+ </target>
+
+</project>
\ No newline at end of file
Added: maven/ant-tasks/trunk/src/it/pom-generation/invoker.properties
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/it/pom-generation/invoker.properties?rev=1085344&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/it/pom-generation/invoker.properties (added)
+++ maven/ant-tasks/trunk/src/it/pom-generation/invoker.properties Fri Mar 25 12:11:01 2011
@@ -0,0 +1 @@
+invoker.goals = validate
Added: maven/ant-tasks/trunk/src/it/pom-generation/pom.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/it/pom-generation/pom.xml?rev=1085344&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/it/pom-generation/pom.xml (added)
+++ maven/ant-tasks/trunk/src/it/pom-generation/pom.xml Fri Mar 25 12:11:01 2011
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+
+<project 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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>ant-run</artifactId>
+ <packaging>pom</packaging>
+
+ <name>ant-run</name>
+ <version>0.10-SNAPSHOT</version>
+ <description>
+ Try to call the ant tasks through the ant run plugin.
+ </description>
+
+ <dependencies><!-- dependencies to be downloaded by ant tasks -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>testfile</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version><!-- uses Ant 1.7.1 by default -->
+ <executions>
+ <execution>
+ <id>run</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="build.xml"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/ant-tasks/trunk/src/it/pom-generation/verify.bsh
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/it/pom-generation/verify.bsh?rev=1085344&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/it/pom-generation/verify.bsh (added)
+++ maven/ant-tasks/trunk/src/it/pom-generation/verify.bsh Fri Mar 25 12:11:01 2011
@@ -0,0 +1,23 @@
+import java.io.*;
+import java.util.*;
+import org.codehaus.plexus.util.*;
+
+try
+{
+ File outputFolder = new File( basedir, "target" );
+
+ File testFile = new File( outputFolder, "parent-pom.xml");
+ if ( !testFile.isFile() )
+ {
+ System.err.println( "Could not find generated file: " + testFile );
+ return false;
+ }
+
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;