root/
image/
folder1/
image1.png
image2.png
folder2/
...
...
txtfolder/
file.txt
lib/
guava.jar
myJar.jar
Deploying above file structure works perfectly, but the requirement is to deploy the above file structure as ONE executable jar file, say myJarAll.jar (naturally, with a size of nearly 600MB).
I have already tried adding jar files and folders to netbean project as dependencies and then doing a clean build but it doesn't generate a myJarAll.jar. Ideal situation would be to have zero changes to the source code and heck up the ant file to make it generate a combined jar.
One solution that I have experimented with is to create external jar files from images and text folders and add them up as dependencies to a project. Problem with this approach is that it expects considerable changes to the original source code.
Any help, suggestion or tools that can solve this problem.
Thanks
Easiest would be to have a myJar.jar
with a META-INF/MANIFEST.MF listing the library jars in lib
. In the lib
folder besides guava.jar
you can create a myResources.jar
stemming from a second project. Or add those files to myJar.jar. (The NetBeans IDE already maintains the manifest.)
Unavoidable is loading the files as read-only java resources on the class path, under the src
directory (see the Files tab in NetBeans). So the question is whether you are already using getClass().getResourceAsStream("/txtfolder/file.txt")
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.