diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index 3cf674bf34e..3cc91f82d9e 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java @@ -49,15 +49,14 @@ public abstract class GroovyTemplate { public static String template(TemplateEngine engine, String name, Map model) throws IOException, CompilationFailedException, ClassNotFoundException { - Writable writable = getTemplate(name).make(model); + Writable writable = getTemplate(engine, name).make(model); StringWriter result = new StringWriter(); writable.writeTo(result); return result.toString(); } - private static Template getTemplate(String name) throws CompilationFailedException, + private static Template getTemplate(TemplateEngine engine, String name) throws CompilationFailedException, ClassNotFoundException, IOException { - GStringTemplateEngine engine = new GStringTemplateEngine(); File file = new File("templates", name); if (file.exists()) {