You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Dubois, Fabien" <fa...@capgemini.com> on 2008/04/30 10:33:14 UTC
Problem to use ant contrib
Hi everybody,
I try to use ant-contrib to create a task which detects if a file is
present, and if not copy the file in the folder.
So I have get back the source of ant-contrib, build and create the jar.
This is my task :
<target name="local.deploy.init"
description="copy the jdbc librairy in the $CATALINA_HOME/lib">
<taskdef uri="antlib:net.sf.antcontrib"
resource="net/sf/antcontrib/cpptasks/antlib.xml"
classpath="${lib}/cpptasks.jar"/>
<if>
<fail
file="${tomcat}/lib/mysql-connector-java-5.1.5-bin.jar"/>
<then>
<copy todir="${tomcat}/lib">
<fileset
file="${lib}/mysql-connector-java-5.1.5-bin.jar"/>
</copy>
</then>
</if>
</target>
Ant stops this task at the < if > (so there is no problem for the
taskdef):
D:\workspace\appWicket\trunk\build.xml:81: 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.
Moreover sourceforge is currently off, so I can't verify the syntax.
If you can help me, thank you in advance :-)
Re: Problem to use ant contrib
Posted by Peter Reilly <pe...@gmail.com>.
Also, the taskdef defines a namespace uri (antlib:net.sf.antcontrib)
but the script does not bind this to a namespace prefix and in any
case does not use a namespace prefix with the <if> tag.
the definition should be something like this:
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${lib}/antcontrib.jar"/>
<if>
...
or (ant 1.7)
<taskdef uri="antlib:net.sf.antcontrib"
classpath="${lib}/antcontrib.jar"/>
<ac:if xmlns:ac=""antlib:net.sf.antcontrib">
..
</ac:if>
Peter
On Wed, Apr 30, 2008 at 9:54 AM, Stefan Bodewig <bo...@apache.org> wrote:
> On Wed, 30 Apr 2008, Fabien Dubois <fa...@capgemini.com> wrote:
>
> > <taskdef uri="antlib:net.sf.antcontrib"
> > resource="net/sf/antcontrib/cpptasks/antlib.xml"
> > classpath="${lib}/cpptasks.jar"/>
> >
> > <if>
> >
>
> > Ant stops this task at the < if > (so there is no problem for the
> > taskdef):
>
> I don't think cpptasks.jar contains the if-task, you need the
> ant-contrib.jar for that.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Problem to use ant contrib
Posted by "Dubois, Fabien" <fa...@capgemini.com>.
Where I can find ant-contrib.jar?? because source forge is off...
Thank you
-----Message d'origine-----
De : Stefan Bodewig [mailto:bodewig@apache.org]
Envoyé : mercredi 30 avril 2008 10:54
À : user@ant.apache.org
Objet : Re: Problem to use ant contrib
On Wed, 30 Apr 2008, Fabien Dubois <fa...@capgemini.com> wrote:
> <taskdef uri="antlib:net.sf.antcontrib"
> resource="net/sf/antcontrib/cpptasks/antlib.xml"
> classpath="${lib}/cpptasks.jar"/>
>
> <if>
>
> Ant stops this task at the < if > (so there is no problem for the
> taskdef):
I don't think cpptasks.jar contains the if-task, you need the
ant-contrib.jar for that.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Problem to use ant contrib
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 30 Apr 2008, Fabien Dubois <fa...@capgemini.com> wrote:
> <taskdef uri="antlib:net.sf.antcontrib"
> resource="net/sf/antcontrib/cpptasks/antlib.xml"
> classpath="${lib}/cpptasks.jar"/>
>
> <if>
>
> Ant stops this task at the < if > (so there is no problem for the
> taskdef):
I don't think cpptasks.jar contains the if-task, you need the
ant-contrib.jar for that.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org