}
private void copyTemplateTo(final File targetDir, final String filename) throws Exception {
// don't break apps using Velocity facade
final VelocityEngine engine = new VelocityEngine();
engine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, new NullLogChute());
engine.setProperty(Velocity.RESOURCE_LOADER, "class");
engine.setProperty("class.resource.loader.description", "Velocity Classpath Resource Loader");
engine.setProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
engine.init();
final Template template = engine.getTemplate("/org/apache/tomee/configs/" + filename);