On 12/14/2010 11:19 AM, Ashokkumar B wrote:
Dear Sir/Madam,
Currently we need to add only one<module> into my application.xml file using
ANT. To achive that, we have a template for application.xml with token $module$
and it will be replaced with actual module name using<replace> task. The
changed application.xml will be used for the<ear> task to generate the EAR
file.
Similarly I need to add EJB jars as<module> in my application.xml file.
<module id="EJB_12345">
<ejb>lsbframelib.jar</ejb>
</module>
I can keep application.xml as a template if I know the number of EJB jar files
exactly and I can use<replace> task to replace the token with exact jar file .
But it may vary according to the project.
Say if I have 'n' number of EJB jar files, I need to mention all such jar files
as modules in my application.xml file.
How to achieve this?
I would do this using an XSLT transformation.
<xslt/> is an ant task.
Assuming your ejb jars are all in one directory, you can do something like
<fileset dir="somedir" id="ejbjars">
<include name="*.jar"/>
</fileset>
<xslt in="application.xml.template" out="application.xml"
style="addejbjars.xsl">
<param name="jarlists" expression="${toString:ejbjars}"/>
</xslt>
Then the next question is how to write your addejbjars.xsl. Probably
start with templates copying the complete data, and insert somewhere a
loop structure to create your ejb modules.
Please let me know if it is clear or not.
Thanks and Regards,
Ashokkumar B.
Regards,
Antoine
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org