You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Paul Perevalov <pp...@cyber-asp.com> on 2001/03/05 23:57:12 UTC

ftp task couldn't be created in Ant 1.3

Hi,

I've tried to use ftp task in Ant 1.3 (NetComponents.jar is in lib) but I'm
getting this error:
"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)."

default.properties file from ant.jar has this line:
ftp=org.apache.tools.ant.taskdefs.optional.net.FTP
but in in optional.jar FTP.class is in
org.apache.tools.ant.taskdefs.optional.FTP package.
like it was in previous Ant version.

Thanks,

Pavel Perevalov




Re: Lesson learned in building optional.jar

Posted by David Rees <d....@usa.net>.
On Tue, 6 Mar 2001 11:16:18 -0800, Skip Hovsmith wrote:

>Just thought I'd pass on a lesson learned in building optional.jar.
>
>I wrap most java apps with a script which sets the appropriate classpath. My
>default classpath is empty.
>
>With ant 1.3, I built the source using 'ant install'. The ant script
>included the jars it needed, but couldn't include the optional dependencies
>such as junit.jar. The build install ran and completed successfully.
>
>Next I fire up ant with a known build.xml file which dutifully sets
>junit.jar when running the junit task. The junit task fails saying it can't
>find the test runner. When I look for the test runner in optional.jar, it's
>not there! After wondering (perhaps a mild understatement) how the ant
>developers could leave the junit tasks out of optional.jar, I finally catch
>on that the classes weren't added to the optional.jar because I didn't have
>junit.jar on my classpath for the original build install. Obvious now, but
>it sure tripped me up for a while...
>
>The original build install probably output that it failed to build some of
>the junit related classes, but I just saw the build completed okay message
>at the end and mindlessly moved on.
>

Nope, it doesn't give any warnings because Junit is "optional" ;).

>So, if your optional.jar is missing some tasks, make sure you've added all
>the optional dependency jars to your classpath before building ant or just
>grab the optional.jar off the ant distribution.
>

The problem is that you ran ant directly instead of using build.bat or
build.sh. They automatically add the optional jars to the class path
if it exists. Not sure why this doesn't happen in build.xml instead,
especially for junit.jar since its in the build.

d


Lesson learned in building optional.jar

Posted by Skip Hovsmith <sk...@maplerise.com>.
Just thought I'd pass on a lesson learned in building optional.jar.

I wrap most java apps with a script which sets the appropriate classpath. My
default classpath is empty.

With ant 1.3, I built the source using 'ant install'. The ant script
included the jars it needed, but couldn't include the optional dependencies
such as junit.jar. The build install ran and completed successfully.

Next I fire up ant with a known build.xml file which dutifully sets
junit.jar when running the junit task. The junit task fails saying it can't
find the test runner. When I look for the test runner in optional.jar, it's
not there! After wondering (perhaps a mild understatement) how the ant
developers could leave the junit tasks out of optional.jar, I finally catch
on that the classes weren't added to the optional.jar because I didn't have
junit.jar on my classpath for the original build install. Obvious now, but
it sure tripped me up for a while...

The original build install probably output that it failed to build some of
the junit related classes, but I just saw the build completed okay message
at the end and mindlessly moved on.

So, if your optional.jar is missing some tasks, make sure you've added all
the optional dependency jars to your classpath before building ant or just
grab the optional.jar off the ant distribution.

Regards, Skip Hovsmith

RE: ftp task couldn't be created in Ant 1.3

Posted by Paul Perevalov <pp...@cyber-asp.com>.
Sorry, I messed optional.jar from Ant1.2 with Ant1.3
My bad.

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Tuesday, March 06, 2001 2:01 AM
To: ant-user@jakarta.apache.org
Subject: Re: ftp task couldn't be created in Ant 1.3


Paul Perevalov <pp...@cyber-asp.com> wrote:

> default.properties file from ant.jar has this line:
> ftp=org.apache.tools.ant.taskdefs.optional.net.FTP
> but in in optional.jar FTP.class is in
> org.apache.tools.ant.taskdefs.optional.FTP package.
> like it was in previous Ant version.

I've just checked jakarta-ant-1.3-optional.jar in the download
directory, The FTP class is in the ...optional.net package. Where did
you get your optional.jar from?

Stefan


Re: ftp task couldn't be created in Ant 1.3

Posted by Stefan Bodewig <bo...@apache.org>.
Paul Perevalov <pp...@cyber-asp.com> wrote:

> default.properties file from ant.jar has this line:
> ftp=org.apache.tools.ant.taskdefs.optional.net.FTP
> but in in optional.jar FTP.class is in
> org.apache.tools.ant.taskdefs.optional.FTP package.
> like it was in previous Ant version.

I've just checked jakarta-ant-1.3-optional.jar in the download
directory, The FTP class is in the ...optional.net package. Where did
you get your optional.jar from?

Stefan