ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <flo...@mindspring.com>
Subject Re: ant-contrib question
Date Sat, 05 Jan 2008 16:28:42 GMT
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 <mpc8250@gmail.com> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message