Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem: failed to create task or type for Cause: The name is undefined.

 
zabin shariff
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I was trying to iterate a list using for tag in my build.xml. But getting this error:



My build .xml looks like this:


Can anybody tell where I am doing wrong

FYI: I am using eclipse 3.5 which has ANT3.7
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the for task a standard task in ANT?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "for" task is in ant-contrib. Have you installed it correctly? Have you provided a taskdef for it that you're not showing here?

http://ant-contrib.sourceforge.net/
 
zabin shariff
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

It seems I have not provided a typedef for "for" . I corrected myself and changed my code to this:


I got this error:


So I checked the plugins library in eclipse folder and found that there is no ant-lib there. So I downloaded one and copied it to the lib folder of the ant plugin. But still I am getting the same error. Do I need to set the path somewhere. I am using Eclipse Galileo 3.5 which has ANT as plugin so i haven't downloaded ANT and configured it in my system manually.
Any suggestions
 
zabin shariff
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there
I got the solution
I imported the jar(ant-contrib-1.0b3 which I have downloaded and kept in eclipse/plugins/org.apache.ant_1.7.1.v20090120-1145/lib) in Eclipse, by Windows--?Preferences-->Ant-->Runtime--->Add External Jars in Ant Home Entries.
Now my build.xml is working fine:
Here is my snippet:

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to hear you got it working!
 
John Kaplan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more addition - sometimes ant is thick about finding its lib directory, so it doesn't look like you added the ant-contrib-jar even when you did.
One way to check that is to add a -lib <hard path to your ant lib directory> to the end of your ant command line & see if this problem goes away.
If so, ant is looking in the wrong lib directory on your system.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic