tags:

views:

43

answers:

1

This is my build target

   <target name="build-war" depends="build-java">        
     <war destfile="${dist.dir}/${std.war.file}" webxml="${resources.dir}/WEB-INF/web.xml">  
      <fileset dir="${jsp.dir}" />
       <lib dir="${lib.dir}"/>  
       <classes dir="${build.classes.dir}" />  
     </war>  
   </target>

Here for <lib> can i specify some how a fileset / pattern set ?

  1. Basically i want to copy different jar from different places. (Not in one directlry)

  2. And That fileset or patternset i want to be defined in another build file which actually imports this build file.

       <lib refid="${patternset.id}"/>
    
A: 

You can simply define several <lib> elements:

<war destfile="myjar.jar">
    <lib dir="${dir1}" includes="*.jar"/>
    <lib dir="${dir2}" includes="*.jar"/>
</war>
Vladimir
Yes...But my issue is, this is a root build file. And the children will have list of files to be copied.root-build.xml<war destfile="myjar.jar">// Need list of files to be copied into lib</war>child-build.xml<import "root-build.xml">//Contains a patternset or something that has list of files.I considered alternative like pathTofileset and filese, but all of them need root directory.Where as in my case, I have files from different directories. In essence, Is there a datastructure which can take list of files and i can refer to that in war target ?
Jigar Shah