java - How can I include data text files in a jar using Ant? -


The data name in my src folder is another folder that contains data data.txt and data2.txt. The application loads the graph initially from these files, so I want to include these files in my final jar. I use ant to make jar file.

Example:

  & lt; Jar destfile = "$ {dist} /lib/app.jar" & gt; & Lt; Fileset dir = "$ {build} / classes" / & gt; & Lt; Fileset dir = "$ {src} / resources" / & gt; & Lt; / Jar & gt;  

So basically you want to include data-files in the same way as "resources" are included above.

From the documentation of & lt; Jar & gt; Task:

It is possible to refine the set of files that are waterfalls. This is included, which contains the file, is not included, with the excluded file and defaultexcludes attributes.


Comments