diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 791c83014181..5bf0b0728d38 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -126,6 +126,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "templateDirectory") private File templateDirectory; + /** + * The name of templating engine to use, "mustache" (default) or "handlebars" (beta) + */ + @Parameter(name = "engine", defaultValue = "mustache") + private String engine; + /** * Adds authorization headers when fetching the swagger definitions remotely. " Pass in a * URL-encoded string of name:header with a comma separating multiple values @@ -550,6 +556,10 @@ public void execute() throws MojoExecutionException { configurator.setTemplateDir(templateDirectory.getAbsolutePath()); } + if (null != engine) { + configurator.setTemplatingEngineName(engine); + } + // Set generation options if (null != generateApis && generateApis) { GeneratorProperties.setProperty(CodegenConstants.APIS, "");