Martin Gladdish wrote:

All,

I'm struggling with clearing a property value that was set using the <loadfile> task.

Here's the relevant section of my build file:

<loadfile property="web-xml-fragment" srcFile="${target.custom.src.dir}/generated_web.xml"/>
<filter token="precompiled_jsp" value="${web-xml-fragment}"/>
<copy file="${source.web.dir}/WEB-INF/web.xml" tofile="${target.custom.webinf.dir}/web.xml" filtering="true" overwrite="true" />
<property name="web-xml-fragment" value="nothing"/>
<echo>web-xml-fragment: ${web-xml-fragment}</echo>


The web-xml-fragment property gets set correctly, and I get the correctly filtered web.xml out at the end of the <copy> task. That's all fine.
I then set the web-xml-fragment property to be "nothing".
The <echo> statement should then just print the word "nothing", shouldn't it?

No, by design ant properties can not be set more that once.


In fact, it prints the contents of generated_web.xml.

So, <property name="web-xml-fragment" value="nothing"/>, in fact doesn't appear to set anything.

I need to clear the property, so that it doesn't overwhelm my junit reports.

I see the problem...
There is a proposal to allow an option to be given to junit to suppress
reporting of the properties. (cannot remember the bugzilla number at the moment).


In the meantime, you could use the "<var>" task from ant-contrib to reset the property.
<ac:var name="web-xml-fragment" value="nothing" xmlns:ac="antlib:net.sf.antcontrib"/>


Peter


ant -version > Apache Ant version 1.6.2 compiled on July 16 2004

Any help would be greatly appreciated.

Many thanks,

Martin Gladdish
e-Government Solutions (UK) Ltd



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





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



Reply via email to