You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "DUBCHAK, JOHN [Non-Pharmacia/1000]" <jo...@monsanto.com> on 2001/08/24 21:00:45 UTC

FTP Optional Task

Hello,

I realize this question has probably been asked a thousand times but I can't
seem to find the solution and am getting frustrated with it...

I'm trying to create a task to ftp to a unix server from my WinNT machine.
The task is defined as follows:

  <target name="ftp_scripts">
    <ftp server="theServer"
	 remotedir="${scripts.deploy.dir}"
	 userid="myUser"
	 password="myPassword"
	 depends="yes">
        <fileset dir="${scripts.dir}" includes="*.sh"/>
    </ftp>
  </target>

I downloaded the optional.jar file for Ant 1.3 and put it into
%ANT_HOME%\lib, but get the following error when trying to execute the
target:

C:\source\ant_builds\build.xml:128: Could 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).

Any assistance is greatly appreciated.

Thanks in advance,
John

Re: FTP Optional Task

Posted by T Master <tm...@iknowledgeinc.com>.
NETCOMPONENTS.JAR!!!

DOWNLOAD IT!!


----- Original Message -----
From: "DUBCHAK, JOHN [Non-Pharmacia/1000]" <jo...@monsanto.com>
To: <an...@jakarta.apache.org>
Sent: Friday, August 24, 2001 1:00 PM
Subject: FTP Optional Task


> Hello,
>
> I realize this question has probably been asked a thousand times but I
can't
> seem to find the solution and am getting frustrated with it...
>
> I'm trying to create a task to ftp to a unix server from my WinNT machine.
> The task is defined as follows:
>
>   <target name="ftp_scripts">
>     <ftp server="theServer"
> remotedir="${scripts.deploy.dir}"
> userid="myUser"
> password="myPassword"
> depends="yes">
>         <fileset dir="${scripts.dir}" includes="*.sh"/>
>     </ftp>
>   </target>
>
> I downloaded the optional.jar file for Ant 1.3 and put it into
> %ANT_HOME%\lib, but get the following error when trying to execute the
> target:
>
> C:\source\ant_builds\build.xml:128: Could 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).
>
> Any assistance is greatly appreciated.
>
> Thanks in advance,
> John
>


Re: FTP Optional Task

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "James Bullington" <sh...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Friday, August 24, 2001 10:53 PM
Subject: RE: FTP Optional Task


> Hope this helps (and that I havn't offended anyone)

No, we can live with Criticism. The problem is just that "we" use Ant every
day and know such things, so you don't even think about if it could be
misunderstood to "add something to the classpath" because every
Ant-Developer know that the simpliest way is to drop the file in
$AN_HOME/lib to do this.

I will have a look at the docs this weekend and try to improve this.

Thanks for you help.

Nico



RE: FTP Optional Task

Posted by James Bullington <sh...@yahoo.com>.
Sorry about my previous comment.  The problem that I
had with the documentation was that it said to "add it
to the classpath".  When I first read this,  I
assummed that the file has to be added to a directory
that was in my classpath.  Later on,  I realized that
you meant exactly what you said.  An example in the
documentation would have left no questions.

As far as directory structures.  For my use,  I wanted
to deploy builds from my NT machine to my Solaris
machine in particular directories.  FTP seemed to work
as long as the parent directory existed.  This meant
that I had to add to my script a telnet session that
created that directory first, then did the FTP.  My
FTP command looked like this...

<ftp server="servername" port="portnumber"
remotedir="/dir/dir/dir/dir" userid="${username}"
password="${password}" binary="yes">
    <fileset dir="${basedir}/${source}/content"/>
</ftp>

Hope this helps (and that I havn't offended anyone)
--Jim

--- Ylan Segal <yl...@digiworks.tv> wrote:
> Has anyone experienced problems the ftp task with
> directory structures? I
> find that if the structure is not made in the
> server, the ftp task fails. I
> thought that it would work like a copy task.
> 
> > -----Original Message-----
> > From: Mitchell Ackermann
> [mailto:mitchell.ackermann@epsiia.com]
> > Sent: Friday, August 24, 2001 2:06 PM
> > To: ant-user@jakarta.apache.org
> > Subject: Re: FTP Optional Task
> >
> >
> > When I first started experimenting with the <ftp>
> task, I thought
> > the documentation
> > was pretty straight-forward. I got the
> netcomponents.jar before I
> > tried the task, and
> > my build task worked the first time I tried it.
> >
> > Mitchell Ackermann
> >
> > ----- Original Message -----
> > From: Nico Seessle <ni...@apache.org>
> > To: <an...@jakarta.apache.org>
> > Sent: Friday, August 24, 2001 2:58 PM
> > Subject: Re: FTP Optional Task
> >
> >
> > ----- Original Message -----
> > From: "James Bullington" <sh...@yahoo.com>
> > To: <an...@jakarta.apache.org>
> > Sent: Friday, August 24, 2001 9:06 PM
> > Subject: Re: FTP Optional Task
> >
> >
> > > The documentation kinda-sucks on this one.  You
> need
> > > to have the following in your class path...
> > >
>
%ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar
> >
> > OK, can you please tell us what us the problem
> with the documentation?
> >
> > If you go to
> >
>
http://jakarta.apache.org/ant/manual/OptionalTasks/ftp.html
> you
> > are seeing:
> >
> > "FTP
> >
> > Description
> >
> > Note: The ftp-task uses the NetComponents-Package
> which you will need to
> > download from http://www.savarese.org and add to
> your classpath."
> >
> > where "Note" is written in bold.
> >
> > Is it so hard to understand? How could it be
> written better?
> >
> > Thanks
> >
> > Nico
> >
> >
> >
> 


=====
Support anti-Spam legislation.
Join the fight http://www.cauce.org/

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

RE: FTP Optional Task

Posted by Roustem Karimov <ro...@yahoo.com>.
I prepare complete directory structure on client first and then send ftp
it:

		<ftp server="${remote.host}" 
			userid="${remote.userid}" 
			password="${remote.password}"
			remotedir="${remote.deploy.home}">
			<fileset dir="${dir.tmp}">
				<include name="**/${dir.deploy}/**"/>
			</fileset>			
		</ftp>

This creates all subdirectories on the server.

-----Original Message-----
From: Ylan Segal [mailto:ylan@digiworks.tv] 
Sent: August 24, 2001 5:32 PM
To: ant-user@jakarta.apache.org
Subject: RE: FTP Optional Task


Has anyone experienced problems the ftp task with directory structures?
I find that if the structure is not made in the server, the ftp task
fails. I thought that it would work like a copy task.

> -----Original Message-----
> From: Mitchell Ackermann [mailto:mitchell.ackermann@epsiia.com]
> Sent: Friday, August 24, 2001 2:06 PM
> To: ant-user@jakarta.apache.org
> Subject: Re: FTP Optional Task
>
>
> When I first started experimenting with the <ftp> task, I thought the 
> documentation was pretty straight-forward. I got the netcomponents.jar

> before I tried the task, and
> my build task worked the first time I tried it.
>
> Mitchell Ackermann
>
> ----- Original Message -----
> From: Nico Seessle <ni...@apache.org>
> To: <an...@jakarta.apache.org>
> Sent: Friday, August 24, 2001 2:58 PM
> Subject: Re: FTP Optional Task
>
>
> ----- Original Message -----
> From: "James Bullington" <sh...@yahoo.com>
> To: <an...@jakarta.apache.org>
> Sent: Friday, August 24, 2001 9:06 PM
> Subject: Re: FTP Optional Task
>
>
> > The documentation kinda-sucks on this one.  You need
> > to have the following in your class path... 
> > %ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar
>
> OK, can you please tell us what us the problem with the documentation?
>
> If you go to 
> http://jakarta.apache.org/ant/manual/OptionalTasks/ftp.html you are 
> seeing:
>
> "FTP
>
> Description
>
> Note: The ftp-task uses the NetComponents-Package which you will need 
> to download from http://www.savarese.org and add to your classpath."
>
> where "Note" is written in bold.
>
> Is it so hard to understand? How could it be written better?
>
> Thanks
>
> Nico
>
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


RE: FTP Optional Task

Posted by Ylan Segal <yl...@digiworks.tv>.
Has anyone experienced problems the ftp task with directory structures? I
find that if the structure is not made in the server, the ftp task fails. I
thought that it would work like a copy task.

> -----Original Message-----
> From: Mitchell Ackermann [mailto:mitchell.ackermann@epsiia.com]
> Sent: Friday, August 24, 2001 2:06 PM
> To: ant-user@jakarta.apache.org
> Subject: Re: FTP Optional Task
>
>
> When I first started experimenting with the <ftp> task, I thought
> the documentation
> was pretty straight-forward. I got the netcomponents.jar before I
> tried the task, and
> my build task worked the first time I tried it.
>
> Mitchell Ackermann
>
> ----- Original Message -----
> From: Nico Seessle <ni...@apache.org>
> To: <an...@jakarta.apache.org>
> Sent: Friday, August 24, 2001 2:58 PM
> Subject: Re: FTP Optional Task
>
>
> ----- Original Message -----
> From: "James Bullington" <sh...@yahoo.com>
> To: <an...@jakarta.apache.org>
> Sent: Friday, August 24, 2001 9:06 PM
> Subject: Re: FTP Optional Task
>
>
> > The documentation kinda-sucks on this one.  You need
> > to have the following in your class path...
> > %ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar
>
> OK, can you please tell us what us the problem with the documentation?
>
> If you go to
> http://jakarta.apache.org/ant/manual/OptionalTasks/ftp.html you
> are seeing:
>
> "FTP
>
> Description
>
> Note: The ftp-task uses the NetComponents-Package which you will need to
> download from http://www.savarese.org and add to your classpath."
>
> where "Note" is written in bold.
>
> Is it so hard to understand? How could it be written better?
>
> Thanks
>
> Nico
>
>
>


Re: FTP Optional Task

Posted by Mitchell Ackermann <mi...@epsiia.com>.
When I first started experimenting with the <ftp> task, I thought the documentation
was pretty straight-forward. I got the netcomponents.jar before I tried the task, and
my build task worked the first time I tried it.

Mitchell Ackermann

----- Original Message ----- 
From: Nico Seessle <ni...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Friday, August 24, 2001 2:58 PM
Subject: Re: FTP Optional Task


----- Original Message -----
From: "James Bullington" <sh...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Friday, August 24, 2001 9:06 PM
Subject: Re: FTP Optional Task


> The documentation kinda-sucks on this one.  You need
> to have the following in your class path...
> %ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar

OK, can you please tell us what us the problem with the documentation?

If you go to http://jakarta.apache.org/ant/manual/OptionalTasks/ftp.html you
are seeing:

"FTP

Description

Note: The ftp-task uses the NetComponents-Package which you will need to
download from http://www.savarese.org and add to your classpath."

where "Note" is written in bold.

Is it so hard to understand? How could it be written better?

Thanks

Nico




Re: FTP Optional Task

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "James Bullington" <sh...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Friday, August 24, 2001 9:06 PM
Subject: Re: FTP Optional Task


> The documentation kinda-sucks on this one.  You need
> to have the following in your class path...
> %ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar

OK, can you please tell us what us the problem with the documentation?

If you go to http://jakarta.apache.org/ant/manual/OptionalTasks/ftp.html you
are seeing:

"FTP

Description

Note: The ftp-task uses the NetComponents-Package which you will need to
download from http://www.savarese.org and add to your classpath."

where "Note" is written in bold.

Is it so hard to understand? How could it be written better?

Thanks

Nico



Re: FTP Optional Task

Posted by James Bullington <sh...@yahoo.com>.
The documentation kinda-sucks on this one.  You need
to have the following in your class path...
%ANT_HOME%\lib\optional.jar;%ANT_HOME%\lib\NetComponents.jar

optional.jar is required for the optional tasks.
NetComponents.jar is required for any task that would
make use of the network like telnet, ftp, etc.

Hope this helps,
Jim

--- "DUBCHAK, JOHN [Non-Pharmacia/1000]"
<jo...@monsanto.com> wrote:
> Hello,
> 
> I realize this question has probably been asked a
> thousand times but I can't
> seem to find the solution and am getting frustrated
> with it...
> 
> I'm trying to create a task to ftp to a unix server
> from my WinNT machine.
> The task is defined as follows:
> 
>   <target name="ftp_scripts">
>     <ftp server="theServer"
> 	 remotedir="${scripts.deploy.dir}"
> 	 userid="myUser"
> 	 password="myPassword"
> 	 depends="yes">
>         <fileset dir="${scripts.dir}"
> includes="*.sh"/>
>     </ftp>
>   </target>
> 
> I downloaded the optional.jar file for Ant 1.3 and
> put it into
> %ANT_HOME%\lib, but get the following error when
> trying to execute the
> target:
> 
> C:\source\ant_builds\build.xml:128: Could 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).
> 
> Any assistance is greatly appreciated.
> 
> Thanks in advance,
> John


=====
Support anti-Spam legislation.
Join the fight http://www.cauce.org/

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/