I have my script as following:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Getting from FTP" default="info" basedir=".">
<target name="info">
<property name="testfolder" value="My\Test\Folder\Path" />
<echo>Hello World - Welcome to Apache Ant!</echo>
<echo>Java version: ${ant.java.version}</echo>
<echo>Ant Version: ${ant.version}</echo>
<echo>Base Dir: "${basedir}"</echo>
<mkdir dir="${testfolder}\ant-test"/>
<classpath>
<fileset dir="${basedir}" includes="*.jar" />
</classpath>
<ftp action="get"
server="my.server.location.somewhere"
userid="username"
password="password"
remotedir="/path/on/my/server"
verbose="yes"
>
<fileset dir="${testfolder}\ant-test">
<include name="**\*" />
</fileset>
</ftp>
</target>
</project>
I am writing the file on eclipse, and putting up the commons-net-3.3.jar file in my workspace folder. Here, it is AutomateDownload. But, when I run the script, I get this error:
Buildfile: mydrive\on_server\my_workspace\ftpauto\AutomateDownload\build.xml
info:
[echo] Hello World - Welcome to Apache Ant!
[echo] Java version: 1.8
[echo] Ant Version: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
[echo] Base Dir: "mydrive\on_server\my_workspace\ftpauto\AutomateDownload"
BUILD FAILED
mydrive\on_server\my_workspace\ftpauto\AutomateDownload\build.xml:11: Problem: failed to create task or type classpath
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
It worked on my local machine, as I had kept the .jar file in my lib folder of the ANT_HOME. It worked perfectly. But now when I run it on my server machine, the error is faced by me. Can anyone help with the problem I am suffering, and also could you tell me in detail, what really is the problem? Why did I face this kind of problem? Thanks :)