File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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.
 
IntelliJ Java IDE
 
subject: including a file in a build
 
Threads others viewed
Running unit test cases automatically with Ant
Question on Ant script error in my build.xml file in the Eclipse IDE
JAVA DOC
Ant Build Successful but neither jar file nor build folder created ?
urgent help please (creating jar file using ant)
developer file tools