What is the best practice for including template group files in a jar?
I would like to include my StringTemplateGroup file in my executable jar. I'm using Eclipse and have put the template group file in a folder called "template" under the project. In my java code, I create the files using:
STGroup File templates = new STGroupFile("template/file.stg");
This works fine in Eclipse, but when I export the jar and run it, I get the following error:
Exception in thread "main" java.lang.IllegalArgumentException: No such group file: template\HasbroServiceHelper.stg
How do I get the name of the file in the jar file itself, so I can prefix with "jar:file" or is there a better way to package the template file in the jar?