How can you specify the ant build file to recursively add all files to the bin directory in jarfile?

I have the following ant build file, which should pack all the class files in the bin directory into a jarfile:

<?xml version="1.0" encoding="utf-8"?> <project name="RemoteJunitXletServer.makejar" default="makejar" basedir="."> <target name="makejar" description="Build a jarfile based on the JunitServer project"> <jar jarfile="JunitServer.jar" includes="**.class" basedir="bin" /> </target> </project> 

Unfortunately, including "**. Class" contains only two directories and does not copy files located deeper than two directories inside the bin folder. Should these directories be explicitly declared? Or is there a way to tell ant to simply copy all the class files inside the bin folder regardless of location while maintaining the folder structure?

+4
source share
1 answer

Try includes="**/**.class" ...

+9
source

Source: https://habr.com/ru/post/1369525/


All Articles