1

I would like to use 'ant-contrib', but I could not use it. I tried to use 3 way, without success.

Apache Ant(TM) version 1.8.2

 echo $ANT_HOME
 /usr/share/ant

./usr/share/ant/lib/ant-contrib-1.0b2.jar
./usr/share/java/ant/ant-contrib-1.0b2.jar
./usr/share/java/ant.jar

*1.*
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />

RESULT:
Buildfile: /home/username/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib           
/antcontrib.properties. It could not be found.

*2.*
<taskdef resource="net/sf/antcontrib/antlib.xml"/>

RESULT:
Buildfile: /home/username/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml.        It     could not be found.


 *3.* build.xml in my home, and ant-contrib in home/lib
 <classpath id="contrib.classpath.ref">
            <fileset dir="${basedir}/lib"/>
    </classpath>

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="contrib.classpath.ref"/>

 RESULT:
 Buildfile: /home/username/build.xml:2: Problem: failed to create task or type  classpath
 Cause: The name is undefined.
 Action: Check the spelling.

I dont know other solution where I can iterate through a fileset/custom list doing something on them one by one. Thats why its important me. Honestly, why there is no clear documentation ?

user2013619
  • 179
  • 1
  • 8
  • you may be running wrong ant? – Jayan May 17 '13 at 13:17
  • possible duplicate of [Problems getting my ANT builds to work after OS upgrade](http://stackoverflow.com/questions/14259820/problems-getting-my-ant-builds-to-work-after-os-upgrade) – Mark O'Connor May 17 '13 at 18:35
  • Another answer which might help http://stackoverflow.com/questions/15304845/getting-an-error-could-not-load-definitions-from-resource-net-sf-antcontrib-ant/15308399#15308399 – Mark O'Connor May 17 '13 at 18:35
  • Thanks guys for the help and effort, I still have no clue. – user2013619 May 17 '13 at 20:04

1 Answers1

0

The problem was that YAN mentioned above. I have more ant in my system.

All in all, I removed them, a tried again my build xml with a brand new downloaded ant. What is not on the PATH, and started from directory where it is.

I know this is not the best settings, but I could try it what I want, and solving the right setting is just question of time.

Thanks guys above your time and effort.

user2013619
  • 179
  • 1
  • 8