how to include a folder in JAR file using ANT

Posted on 2009-04-18
Last Modified: 2013-12-15

Here is the folder hierarchy of my project. I want to include the folder "res" into the JAR file with the class files. I've use
                      <fileset dir="res"></fileset>

 but it only include the contents of the folder "res" not the whole folder res into JAR file :(

<target name="make-jar" depends="compile" description="">

        <jar destfile="${jar.file}">

        	  <fileset dir="${bin.dir}" includes="**/*.class"></fileset>

	          <fileset dir="res"></fileset>



Open in new window

Question by:pdidominic
    LVL 86

    Expert Comment

    Simply moving the res folder under src might do the trick without even using Ant
    LVL 92

    Accepted Solution




    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    The viewer will learn how to implement Singleton Design Pattern in Java.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now