ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: <param> question
Date Tue, 05 Aug 2003 07:27:34 GMT
On Mon, 4 Aug 2003, William Lopez <> wrote:

> Why isn't the param value being "scoped"?

I don't think I understand the question.  <param> creates a property
that will only exist for the "subbuild" you've invoked with <antcall>
and that will be unset after <antcall>.

> I was under the impression that an <antcall> encapsulates all the
> properties associated with the target being called (unless
> inheritAll="false") including any properties that were set in
> depends target calls.

Not sure what "encapsulate" means here, but it sounds correct.

> What I noticed was that the <param name="jndiPrefix" value="aux" />
> was not being set when the depends call to chk-ejbjndi-outofdate
> target was executed.

>  <target name="chk-ejbjndi-outofdate">
>      <outofdate property="jndi_outofdate">
>        <sourcefiles>
>          <fileset dir="${}"
>          includes="**/*.class"/>
>        </sourcefiles>
>        <targetfiles>
>          <pathelement
> path="${app.module.dir}\${jndiPrefix}\${}"/>
>        </targetfiles>
>      </outofdate>
>      <echo>${jndiPrefix} notuptodate: ${jndi_outofdate}</echo>
>   </target> 
>  <target name="ejb.jar.prefix" depends="chk-ejbjndi-outofdate"
> if="jndi_outofdate">
>      <antcall target="ejb.jar">
>         <param name="jndiPrefix" value="aux" />
>      </antcall>

Let's see.

When you invoke this as 

ant ejb.jar.prefix

the following things happen:

(1) chk-ejbjndi-outofdate will be run (as ejb.jar.prefix depends on

(2) If the property jndi_outofdate has been set, the target
ejb.jar.prefix will be executed.

(3) Ant starts a fresh "subbuild" running ejb.jar.  All properties
that have been set at the point of <antcall> will be set in this
subbuild and have the same value.  In addition there will be a
property named jndiPrefix in the subbuild.

As I don't see the ejb.jar target I cannot say whether it will be
invoked directly or whether any other target gets executed first
(those ejb.jar depends upon will be executed).

I don't see why you expect jndiPrefix to be set while running


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message