Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding ANT Contrib tasks

 
Cindy Martin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

One of my team member facing the problem in running the ANT contrib tasks...we just tried to use one task in the build file and below are the error thrown...

The code of the build file :-
-----------------------

-----------------------

error thrown as :

------------------
[echo] The first five letters of the alphabet are:

BUILD FAILED
C:\Documents and Settings\sv47906\Desktop\Test\build.xml:6: Problem: failed to create task or type for
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.
-------------------------

we are working in eclipse and downloaded the ANT contrib jar file and added to ANT lib......Do i need to add any path in the code ? if it is, please give me an example of how to do it.

Can anyone help me out in executing this build file with contrib task ?

Thanks,
cindy
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You also need to tell your build to recognize the tasks defined in the antcontrib library. To do this (if you placed the antcontrib jar file in ant's lib directory), add the following entry to your build:

 
Cindy Martin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter !!! It worked !!

Cindy
 
priya ramadass
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still face this issue. Even after placing the task reference. Any help is much appreciated.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Priya, welcome to Java Ranch!

Obviously, you did something wrong. But if you don't tell use what it is that you did, how can we point out your mistake?
http://faq.javaranch.com/java/TellTheDetails
 
Kristian Klukon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
priya ramadass wrote:I still face this issue. Even after placing the task reference. Any help is much appreciated.


Use <taskdef resource="net/sf/antcontrib/antlib.xml"/> instead of <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> when using ant >= 1.6
 
Rahul Sudhakar Pawar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kristian Klukon wrote:
priya ramadass wrote:I still face this issue. Even after placing the task reference. Any help is much appreciated.


Use <taskdef resource="net/sf/antcontrib/antlib.xml"/> instead of <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> when using ant >= 1.6


Hey Kristian, Thanks a Lot! Your solution worked.
 
G Chhabra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kristian! I was having the same issue that Priya had. Your reply helped me as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic