summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse N. Glick <jglick@apache.org>2010-07-06 17:26:04 +0000
committerJesse N. Glick <jglick@apache.org>2010-07-06 17:26:04 +0000
commitcb33b4f823ea229a33e8b8683db10915c170cfed (patch)
tree6d9bc317af0750ea0488f4be5a1c04b1a63ffe57
parent8de81028e45c54b750a0024bf64eaa0ea9e369ea (diff)
downloadant-cb33b4f823ea229a33e8b8683db10915c170cfed.tar.gz
Hackish way of making NetRexxC.jar available to the Maven build without using a public repo.
Easy enough to run fetch.xml during Maven build, but complicated by fact that system-scope dependencies are checked for existence before plugins get a chance to run. Also complicated a bit by the fact that adding a plugin dependency to maven-antrun-plugin (on commons-net:commons-net:1.4.0) does not seem to suffice to let Ant load the <ftp> task (which does not support nested <classpath>). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@960950 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--fetch.xml16
-rw-r--r--src/etc/poms/ant-netrexx/pom.xml29
2 files changed, 42 insertions, 3 deletions
diff --git a/fetch.xml b/fetch.xml
index c5e0c7795..d0628d283 100644
--- a/fetch.xml
+++ b/fetch.xml
@@ -224,6 +224,7 @@ Set -Ddest=LOCATION on the command line
depends="init">
<f2 project="commons-net" />
<f2 project="com.jcraft" archive="jsch"/>
+ <available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
</target>
<target name="regexp"
@@ -309,11 +310,11 @@ Set -Ddest=LOCATION on the command line
<f2 project="com.sun.media" archive="jai-codec" repository="http://repository.jboss.org/maven2"/>
</target>
- <target name="netrexx" depends="init-no-m2,-setup-temp-cache,networking,-fetch-netrexx,-cleanup-temp-cache"
+ <target name="netrexx" depends="init-no-m2,-setup-temp-cache,networking,-fetch-netrexx,-fetch-netrexx-no-commons-net,-cleanup-temp-cache"
description="load NetRexx compiler" />
<target name="-fetch-netrexx" depends="-setup-temp-cache"
- description="FTPs NetRexx compiler from IBM site">
+ description="FTPs NetRexx compiler from IBM site" if="have.commons.net">
<get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
filename="NetRexx.zip" localdir="${temp.dir}" />
<copy todir="${dest.dir}" flatten="true">
@@ -324,6 +325,17 @@ Set -Ddest=LOCATION on the command line
</copy>
</target>
+ <target name="-fetch-netrexx-no-commons-net" depends="-setup-temp-cache"
+ description="FTPs NetRexx compiler from IBM site" unless="have.commons.net">
+ <get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip" dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
+ <copy todir="${dest.dir}" flatten="true">
+ <zipfileset src="${temp.dir}/NetRexx.zip">
+ <include name="NetRexx\lib\NetRexxC.jar" />
+ <include name="NetRexx\browse\license.txt" />
+ </zipfileset>
+ </copy>
+ </target>
+
<target name="all"
description="load all the libraries (except jython)"
depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx" />
diff --git a/src/etc/poms/ant-netrexx/pom.xml b/src/etc/poms/ant-netrexx/pom.xml
index 90e38f45a..d86b7aabd 100644
--- a/src/etc/poms/ant-netrexx/pom.xml
+++ b/src/etc/poms/ant-netrexx/pom.xml
@@ -42,12 +42,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<version>1.8.2-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
+ <!-- Processed too early, before maven-antrun-plugin gets a chance to work:
<dependency>
<groupId>com.ibm.netrexx</groupId>
<artifactId>netrexx</artifactId>
<version>2.0.5</version>
- <scope>provided</scope>
+ <scope>system</scope>
+ <systemPath>${basedir}/../../../../lib/optional/NetRexxC.jar</systemPath>
</dependency>
+ -->
</dependencies>
<build>
<plugins>
@@ -60,8 +63,32 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<includes>
<include>org/apache/tools/ant/taskdefs/optional/NetRexxC*</include>
</includes>
+ <!-- Need to use this rather than system scope as above: -->
+ <compilerArguments>
+ <extdirs>${basedir}/../../../../lib/optional</extdirs>
+ </compilerArguments>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}/../../../.." antfile="fetch.xml" target="netrexx">
+ <property name="dest" value="optional"/>
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<sourceDirectory>../../../../src/main</sourceDirectory>
<testSourceDirectory>../../../../src/testcases</testSourceDirectory>