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-ffa450edef68master
@@ -224,6 +224,7 @@ Set -Ddest=LOCATION on the command line | |||||
depends="init"> | depends="init"> | ||||
<f2 project="commons-net" /> | <f2 project="commons-net" /> | ||||
<f2 project="com.jcraft" archive="jsch"/> | <f2 project="com.jcraft" archive="jsch"/> | ||||
<available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/> | |||||
</target> | </target> | ||||
<target name="regexp" | <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"/> | <f2 project="com.sun.media" archive="jai-codec" repository="http://repository.jboss.org/maven2"/> | ||||
</target> | </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" /> | description="load NetRexx compiler" /> | ||||
<target name="-fetch-netrexx" depends="-setup-temp-cache" | <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" | <get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx" | ||||
filename="NetRexx.zip" localdir="${temp.dir}" /> | filename="NetRexx.zip" localdir="${temp.dir}" /> | ||||
<copy todir="${dest.dir}" flatten="true"> | <copy todir="${dest.dir}" flatten="true"> | ||||
@@ -324,6 +325,17 @@ Set -Ddest=LOCATION on the command line | |||||
</copy> | </copy> | ||||
</target> | </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" | <target name="all" | ||||
description="load all the libraries (except jython)" | description="load all the libraries (except jython)" | ||||
depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx" /> | depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx" /> | ||||
@@ -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> | <version>1.8.2-SNAPSHOT</version> | ||||
<scope>compile</scope> | <scope>compile</scope> | ||||
</dependency> | </dependency> | ||||
<!-- Processed too early, before maven-antrun-plugin gets a chance to work: | |||||
<dependency> | <dependency> | ||||
<groupId>com.ibm.netrexx</groupId> | <groupId>com.ibm.netrexx</groupId> | ||||
<artifactId>netrexx</artifactId> | <artifactId>netrexx</artifactId> | ||||
<version>2.0.5</version> | <version>2.0.5</version> | ||||
<scope>provided</scope> | |||||
<scope>system</scope> | |||||
<systemPath>${basedir}/../../../../lib/optional/NetRexxC.jar</systemPath> | |||||
</dependency> | </dependency> | ||||
--> | |||||
</dependencies> | </dependencies> | ||||
<build> | <build> | ||||
<plugins> | <plugins> | ||||
@@ -60,8 +63,32 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma | |||||
<includes> | <includes> | ||||
<include>org/apache/tools/ant/taskdefs/optional/NetRexxC*</include> | <include>org/apache/tools/ant/taskdefs/optional/NetRexxC*</include> | ||||
</includes> | </includes> | ||||
<!-- Need to use this rather than system scope as above: --> | |||||
<compilerArguments> | |||||
<extdirs>${basedir}/../../../../lib/optional</extdirs> | |||||
</compilerArguments> | |||||
</configuration> | </configuration> | ||||
</plugin> | </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> | </plugins> | ||||
<sourceDirectory>../../../../src/main</sourceDirectory> | <sourceDirectory>../../../../src/main</sourceDirectory> | ||||
<testSourceDirectory>../../../../src/testcases</testSourceDirectory> | <testSourceDirectory>../../../../src/testcases</testSourceDirectory> | ||||