Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant Build inside Eclipse Problem

 
Jenny Kim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm just getting back into Ant again at my new work place (I used work with Maven2 in my previous work). And I'm not off to such a good start, I'm trying to run a build.xml script inside eclipse (Ganymede) and I'm getting the following error:

BUILD FAILED
C:\projects\BRANCH\build.common\scripts\init_base.xml:63: Problem: failed to create task or type if
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.

The part in the script it fails on is:


I'm thinking that I need to add an extra library to the "Ant Home Entries" configuration in Eclipse but I'm not sure as to which one.

Any help on this would be greatly appreciated.

Jenny
 
Jenny Kim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arg..Sorry guys I've posted this in the wrong topic .
 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. I'll move this to the Ant forum.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'if' task is not a standard ant task - it is found in the antcontrib library. Have you installed that library, and is it being properly referenced in your build script?
 
Jenny Kim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Peter, I added ant-contrib.jar to the classpath and it worked .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic