aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes including a file in a build Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "including a file in a build" Watch "including a file in a build" New topic
Author

including a file in a build

Mario Bonassin
Greenhorn

Joined: Apr 08, 2004
Posts: 18
I'm trying to include a file into a build that can then be read by the program. Here is my build.xml

and here is the code thay should be able to read a file called 'HELP'

When i compile normally it sees the file fine but how do I include it in the jar.
Thanks
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Mario,
You can include nested filesets in the jar task to include your "HELP" file as part of your JAR.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Mario Bonassin
Greenhorn

Joined: Apr 08, 2004
Posts: 18
I've tried include, includes, and includesfile and none seemed to work. I assume that they are supposed to be withing the <jar> section right? I don't know what I'm doing wrong.
Mario
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Mario,
It should show up in your JAR if you do it correctly. I don't know what happens when you specify the basedir and have nested filesets. I would try just nested filesets for you.

See how that goes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: including a file in a build