I recently found myself needing to embed a velocity template in a project that was being bundled with the web app that I was developing, this meant that the template file would only be accessible from inside a jar file.
I found this blog Apache Velocity - How to load templates from jar which detailed the problem nicely.
The solution is to set the Velocities resource loader as the classpath, giving it access to the bundled classpath.
Properties props = new Properties();
VelocityEngine ve = new VelocityEngine();
VelocityEngineUtils.MergeTemplateIntoString(ve, "templates/MyFileTemplate.vm", Encoding.UTF8.WebName, model);