Author: pgier Date: Fri May 1 22:10:57 2009 New Revision: 770840 URL: http://svn.apache.org/viewvc?rev=770840&view=rev Log: [MANTTASKS-106] Remove relocations from shade plugin configuration. This seems to resolve classloading issues when running the ant tasks inside the antrun plugin. Add IT for checking that this works.
Added: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml (with props) maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml (with props) maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh (with props) maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml (with props) Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/pom.xml Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/pom.xml URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/pom.xml?rev=770840&r1=770839&r2=770840&view=diff ============================================================================== --- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/pom.xml (original) +++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/pom.xml Fri May 1 22:10:57 2009 @@ -191,7 +191,9 @@ </pluginManagement> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> + <version>1.2.1</version> <executions> <execution> <phase>package</phase> @@ -212,15 +214,6 @@ <exclude>ant:ant</exclude> </excludes> </artifactSet> - <relocations> - <relocation> - <pattern>org.codehaus.plexus.util</pattern> - <excludes> - <exclude>org.codehaus.plexus.util.xml.Xpp3Dom</exclude> - <exclude>org.codehaus.plexus.util.xml.pull.*</exclude> - </excludes> - </relocation> - </relocations> </configuration> </execution> </executions> @@ -246,5 +239,44 @@ </plugins> </reporting> </profile> + + <profile> + <id>run-its</id> + <activation> + <property> + <name>maven.test.skip</name> + <value>!true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-invoker-plugin</artifactId> + <version>1.3</version> + <configuration> + <projectsDirectory>src/it</projectsDirectory> + <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> + <pomIncludes> + <pomInclude>*/pom.xml</pomInclude> + </pomIncludes> + <postBuildHookScript>verify.bsh</postBuildHookScript> + <settingsFile>src/it/settings.xml</settingsFile> + <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> + <debug>true</debug> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> </project> Added: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml?rev=770840&view=auto ============================================================================== --- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml (added) +++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml Fri May 1 22:10:57 2009 @@ -0,0 +1,20 @@ +<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:localRepository id="local.repository" path="${basedir}/target/local-repo" layout="default"/> + + <artifact:pom file="pom.xml" id="maven.project"/> + <mkdir dir="target"/> + <touch file="target/${maven.project.build.finalName}"/> + </target> + +</project> \ No newline at end of file Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/build.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml?rev=770840&view=auto ============================================================================== --- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml (added) +++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml Fri May 1 22:10:57 2009 @@ -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/maven-v4_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> + + <build> + <finalName>testfile</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.3</version> + <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> + <dependencies> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-io</artifactId> + <version>1.3.2</version> + </dependency> + </dependencies> +</project> Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh?rev=770840&view=auto ============================================================================== --- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh (added) +++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh Fri May 1 22:10:57 2009 @@ -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, "testfile"); + if ( !testFile.isFile() ) + { + System.err.println( "Could not find generated file: " + testFile ); + return false; + } + +} +catch( Throwable t ) +{ + t.printStackTrace(); + return false; +} + +return true; Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/ant-tasks-in-ant-run-plugin/verify.bsh ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml?rev=770840&view=auto ============================================================================== --- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml (added) +++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml Fri May 1 22:10:57 2009 @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<settings> + <profiles> + <profile> + <id>it-repo</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> +</settings> Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/it/settings.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision