title: Ant: Jar File with src folder in it
body: <p>I have a very big problem. I just created with ant a jar file and everything works, but in the jar file the src folder is ommited, but I need it because I'm referrencing a file from the application.</p>
  
  <p>I.e. I have the following structure in my project ProjectName/src/org/nexLevel/nextLevel/Main.java. I also have ProjectName/config/settings.properties.</p>
  
  <p>When I know build a jar file with ant I get only the folders org/nexLevel/nextLevel/Main.java but not the src folder. How can I get the src folder in my .jar?</p>
  
  <p>Here is my ant script:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;project default="complete build" name="Create runnable jar file"&gt;
      &lt;property name="src.dir" location="src" /&gt;
      &lt;property name="lib.dir" location="lib" /&gt;
      &lt;property name="build.dir" location="bin" /&gt;
      &lt;property name="dist.dir" location="dist" /&gt;
      &lt;property name="docs.dir" location="docs" /&gt;
      &lt;property name="config.dir" location="config" /&gt;
      &lt;property name="build.sysclasspath" value="last" /&gt;
  
      &lt;path id="project-classpath"&gt;
          &lt;fileset dir="${lib.dir}" includes="*.jar" /&gt;
      &lt;/path&gt;
  
      &lt;target name="remove release"&gt;
          &lt;delete dir="${dist.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="clean build"&gt;
          &lt;delete dir="${build.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="clean docs"&gt;
          &lt;delete dir="${docs.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="clean build"&gt;
          &lt;mkdir dir="${build.dir}" /&gt;
          &lt;javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" target="1.8" source="1.8"&gt;
              &lt;classpath refid="project-classpath" /&gt;
              &lt;compilerarg value="-Xlint:none" /&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;target name="docs" depends="clean docs, compile"&gt;
          &lt;mkdir dir="${docs.dir}" /&gt;
          &lt;javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}"&gt;
              &lt;fileset dir="${src.dir}"&gt;
                  &lt;include name="**" /&gt;
              &lt;/fileset&gt;
          &lt;/javadoc&gt;
      &lt;/target&gt;
  
      &lt;target name="build jar" depends="remove release, compile"&gt;
          &lt;mkdir dir="${dist.dir}" /&gt;
          &lt;jar destfile="${dist.dir}/myApp.jar"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Main-Class" value="org.nextLevel.nextLevel.Main" /&gt;
                  &lt;attribute name="Class-Path" value="." /&gt;
              &lt;/manifest&gt;
  
              &lt;fileset dir="${build.dir}" /&gt;
              &lt;zipfileset dir="config" prefix="config" /&gt;
              &lt;zipfileset excludes="META-INF/**" src="lib/postgresql-9.3-1102.jdbc41.jar" /&gt;
          &lt;/jar&gt;
          &lt;antcall target="clean build" /&gt;
      &lt;/target&gt;
  
      &lt;target name="complete build" depends="docs, build jar, clean build" /&gt;
  &lt;/project&gt;
  </code></pre>