Reputation: 1030
Let's say my package organization is like below:
net.sf.myparentpackage
net.sf.test.mysuppackage
The code below includes all classes and subpackages.
<jar destfile="myjar.jar" manifest="MANIFEST.MF">
<fileset dir=".." includes="net/sf/myparentpackage/**"
</jar>
I want to include only requiredclass1.java and requiredclass2.java without listing all class names.
Upvotes: 4
Views: 244
Reputation: 3956
You can do it by put ".java" or ".class" instead of "**"
<jar destfile="myjar.jar" manifest="MANIFEST.MF">
<fileset dir=".." includes="net/sf/myparentpackage/*.java"
</jar>
https://ant.apache.org/manual/Types/fileset.html
Upvotes: 3