You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by George Smith <gs...@budgetext.com> on 2001/10/22 23:41:49 UTC

ant - ftp question

I am trying to ftp from an ANT build.xml file. Have search the archives
and tried following:

Will someone please help as I am a ANT and java novice.
Thanks in advance

Have tried the following:

1. Downloaded and installed NetComponents-1.3.8a
2. Copied the NetComponents.jar file into
E:\jakarta-ant\jakarta-ant-1.4\lib\NetComponents.jar
---above was the solution I found in the archives for the following error
message:

Begin Error Msg
===============
E:\grsHorton\Fullcode\Chapter
02\01_FruityProgram\01_TotalFruit\build.xml:49: Co
uld not create task of type: ftp. Common solutions are to use taskdef to
declare
 your task, or, if this is an optional task, to put the optional.jar in the
lib
directory of your ant installation (ANT_HOME).
===============
End Error Msg


my ANT_Home echo %ANT_HOME%
e:\jakarta-ant\jakarta-ant-1.4


build.xml file follows:
==================================================
<project name="Fruit" default="build" basedir=".">

<target name="init">
  <property name="jardir"  value="e:\jars" />
  <property name="Src"     value="src" />
  <property name="Dest"    value="classes" />
  <property name="Jar"     value="jar" />
</target>

<target name="prepare" depends="init">
  <mkdir dir="${Dest}"/>
  <mkdir dir="${Jar}"/>
</target>

<target name="build" depends="prepare">
  <javac  srcdir="${Src}" destdir="${Dest}">
    <classpath>
      <pathelement location="c:\jdk1.3.0_02\jre\lib\rt.jar"/>
      <pathelement location="e:\NetComponents-1.3.8a\NetComponents.jar"/>
      <pathelement location="${Src}"/>
    </classpath>
  </javac>
</target>

<target name="jar" depends="build">
  <jar jarfile="Fruit.jar" basedir="${Dest}" />
  <jar jarfile="FruitSource.jar" basedir="${Src}" />
</target>


<target name="copy" depends="jar">
  <copy todir="${jardir}">
    <fileset dir="${basedir}" includes="*.jar"/>
  </copy>
  <copy todir="${Jar}">
    <fileset dir="${basedir}" includes="*.jar"/>
  </copy>
</target>


<!--============== Deploy ==============-->
<target name="deploy" depends="copy">
  <ftp action="put"
       server="192.168.111.11"
       userid="grs"
       password="bkstore"
       remotedir="/home/grs/grsFTP"
       binary="yes"
       verbose="yes">
    <fileset dir="${Jar}">
      <include name="**.*"/>
    </fileset>
  </ftp>
</target>


<!--============== Administration ==============-->
<target name="clean" depends="deploy">
  <delete file="${basedir}/Fruit.jar"/>
  <delete file="${basedir}/FruitSource.jar"/>
</target>

</project>


Re: ant - ftp question

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Did you also get the Ant 1.4.1 optional.jar?   That is what contains the
<ftp> task code.  The NetComponents is a dependency for the actual task.

    Erik


----- Original Message -----
From: "George Smith" <gs...@budgetext.com>
To: <an...@jakarta.apache.org>
Sent: Monday, October 22, 2001 5:41 PM
Subject: ant - ftp question


> I am trying to ftp from an ANT build.xml file. Have search the archives
> and tried following:
>
> Will someone please help as I am a ANT and java novice.
> Thanks in advance
>
> Have tried the following:
>
> 1. Downloaded and installed NetComponents-1.3.8a
> 2. Copied the NetComponents.jar file into
> E:\jakarta-ant\jakarta-ant-1.4\lib\NetComponents.jar
> ---above was the solution I found in the archives for the following error
> message:
>
> Begin Error Msg
> ===============
> E:\grsHorton\Fullcode\Chapter
> 02\01_FruityProgram\01_TotalFruit\build.xml:49: Co
> uld not create task of type: ftp. Common solutions are to use taskdef to
> declare
>  your task, or, if this is an optional task, to put the optional.jar in
the
> lib
> directory of your ant installation (ANT_HOME).
> ===============
> End Error Msg
>
>
> my ANT_Home echo %ANT_HOME%
> e:\jakarta-ant\jakarta-ant-1.4
>
>
> build.xml file follows:
> ==================================================
> <project name="Fruit" default="build" basedir=".">
>
> <target name="init">
>   <property name="jardir"  value="e:\jars" />
>   <property name="Src"     value="src" />
>   <property name="Dest"    value="classes" />
>   <property name="Jar"     value="jar" />
> </target>
>
> <target name="prepare" depends="init">
>   <mkdir dir="${Dest}"/>
>   <mkdir dir="${Jar}"/>
> </target>
>
> <target name="build" depends="prepare">
>   <javac  srcdir="${Src}" destdir="${Dest}">
>     <classpath>
>       <pathelement location="c:\jdk1.3.0_02\jre\lib\rt.jar"/>
>       <pathelement location="e:\NetComponents-1.3.8a\NetComponents.jar"/>
>       <pathelement location="${Src}"/>
>     </classpath>
>   </javac>
> </target>
>
> <target name="jar" depends="build">
>   <jar jarfile="Fruit.jar" basedir="${Dest}" />
>   <jar jarfile="FruitSource.jar" basedir="${Src}" />
> </target>
>
>
> <target name="copy" depends="jar">
>   <copy todir="${jardir}">
>     <fileset dir="${basedir}" includes="*.jar"/>
>   </copy>
>   <copy todir="${Jar}">
>     <fileset dir="${basedir}" includes="*.jar"/>
>   </copy>
> </target>
>
>
> <!--============== Deploy ==============-->
> <target name="deploy" depends="copy">
>   <ftp action="put"
>        server="192.168.111.11"
>        userid="grs"
>        password="bkstore"
>        remotedir="/home/grs/grsFTP"
>        binary="yes"
>        verbose="yes">
>     <fileset dir="${Jar}">
>       <include name="**.*"/>
>     </fileset>
>   </ftp>
> </target>
>
>
> <!--============== Administration ==============-->
> <target name="clean" depends="deploy">
>   <delete file="${basedir}/Fruit.jar"/>
>   <delete file="${basedir}/FruitSource.jar"/>
> </target>
>
> </project>
>
>