Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Ant question about FilterSets

Thread view: 
Danno - 20 Sep 2006 18:09 GMT
Do you know of a way of using FilterSets with the war, or jar task?
danharrisandrews@gmail.com - 20 Sep 2006 21:15 GMT
> Do you know of a way of using FilterSets with the war, or jar task?

Yes you can specify a fileset. See these links:
http://ant.apache.org/manual/CoreTasks/jar.html or
http://ant.apache.org/manual/CoreTasks/war.html

However, typically I do a fresh ant build and then include everything
in the classes directory. In my make target I can fuss about which
classes and files to include and exclude. Here are my slightly edited
jar and make targets for another example apart from the ant manual.

<target name="jar" depends="init,clean,make">
   <delete file="${jar.dir}/myjar.jar" />
   <jar destfile="${jar.dir}/myjar.jar" basedir="./classes">
       <manifest>
          <attribute name="Built-By" value="${user.name}" />
          <attribute name="Main-Class" value="mypackage.MyMainClass"/>
          <attribute name="Class-Path" value="." />
       </manifest>
   </jar>
</target>

<target name="make" depends="init">
   <copy todir="${classes.dir}">
       <fileset dir="${source.dir}">
           <include name="**/*.properties" />
           <include name="**/*.gif" />
           <include name="**/*.jpg" />
           <include name="**/*.png" />
           <include name="**/*.txt" />
       </fileset>
   </copy>
   <javac destdir="${classes.dir}" optimize="off" debug="on"
           target="1.5" source="1.5">
       <src path="${source.dir}" />
       <exclude name="**/Test.java" />
       <compilerarg line="-Xlint" />
   </javac>
</target>

Cheers,

Dan Andrews
- - - - - - - - - - - - - - - - - - - - - - - -
Ansir Development Limited www.ansir.ca
- - - - - - - - - - - - - - - - - - - - - - - -
Danno - 20 Sep 2006 22:01 GMT
Thanks for the reponse.

Unfortunately, I was needing a "FilterSet" and not a "FileSet" to use
with my jar/war task.  They are two different things.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.