I agree too - this is an odd problem.  Here is what I tried:

I ran this on both Windows and Linux - it worked.

Here is the build.xml I was using:

<project default = "all" xmlns:ac="antlib:net.sf.antcontrib">

   <target name="all">
       <ac:if>
           <equals arg1 = "Scot"  arg2 = "Floess"/>

           <ac:then>
               <echo  message = "Sure does"/>
           </ac:then>

           <ac:else>
               <echo  message = "Sorry no dice"/>
           </ac:else>
       </ac:if>
   </target>
</project>

I had a fresh install of Ant 1.7.0 and put ant-contrib-1.0b3.jar in $ANT_HOME/lib

A few things I'd look for:

   * Make sure, in fact the Ant contrib jar is in Ant's lib dir.
   * Make sure you don't have 2 versions of Ant installed.  By this I
     mean, you could have one version of Ant in /foo and another
     version in /bar.  You make changes to the version that lives in
     /bar.  However, the version that lives in /foo is the one in your
     path when calling the command "ant"

As Dominique pointed out, it does feel like a classpath issue. That's why I say make sure you are affecting change to a version of Ant that is in your environment path.


Dominique Devienne wrote:
On 1/4/08, Z W <[EMAIL PROTECTED]> wrote:
I'm trying to use tasks in ant-contrid.
So I downloaded ant-contrib-1.0b3-bin and put ant-contrib-1.0b3.jar file in
$ANT_HOME\lib
[...]
xmlns:ac="antlib:net.sf.antcontrib">
[...]
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.

It's not complaining about Ant-Contrib's antlib.xml, but Ant's one,
which is rather strange.

Putting Ant-Contrib's jar in $ANT_HOME/lib and doing
xmlns:ac="antlib:net.sf.antcontrib" should work (no need for a
<taskdef>), so there's most likely something else at play, probably a
classpath issue somehow... --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
Architect Keras          http://sourceforge.net/projects/keras
QA Engineer OpenQabal    http://openqabal.dev.java.net

Reply via email to