Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

jar

ant

I have the following ant build file which is supposed to package all 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" only goes two directories deep, and does not copy any files that are deeper than two directories inside of the bin folder. Do these directories HAVE to be explicitly declared? Or is there a way to tell Ant to just copy all class files inside of the bin folder regardless of location while preserving the folder structure?

like image 206
Bender the Greatest Avatar asked Jan 18 '23 21:01

Bender the Greatest


1 Answers

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

like image 110
IncrediApp Avatar answered Feb 08 '23 16:02

IncrediApp