I want add some resource files (non-code text-based files) to the jar file in a Java project using Netbeans 6.9, I'd expect using Ant. I had thought that this would be reasonably simple...but after quite a bit of searching I can't find how to do it..! Any pointers in the right direction?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
If you choose
File > Project Properties > Build > Packaging
, you'll see a dialog that lets you exclude artifacts from the build; everything else is the source tree is included. The source ofTreeIconDemo
is a concrete example that inlcudeshtml
files.For more advanced tasks, examine the default
build.xml
generated for a freshly created project; it identifies various hooks into the predefined tasks. For example,Addendum: As an example, this target overrides
-post-compile
to print some statistics.Output:
The answer I think I was looking for is as follows:
In the build.xml file (as per trashgod's answer) you can use the hooks already in the ant build script to add the following:
This adds the files directory and any files under it directly to the jar file.