Enforce Java 1.8 when generating spring-mvc with j8-async option

The spring-mvc j8-async code is now located in it's own sample directory
with Java 8 enforced via Maven plug-in.
This commit is contained in:
Ian Chan
2015-12-29 13:40:46 +13:00
parent 916793b820
commit 3103846f45
3 changed files with 185 additions and 1 deletions

View File

@@ -178,6 +178,18 @@ public class SpringMVCServerCodegen extends JavaClientCodegen implements Codegen
apiTemplateFiles.remove(this.templateFileName);
this.templateFileName = "api-j8-async.mustache";
apiTemplateFiles.put(this.templateFileName, ".java");
int originalPomFileIdx = -1;
for (int i = 0; i < supportingFiles.size(); i++) {
if ("pom.xml".equals(supportingFiles.get(i).destinationFilename)) {
originalPomFileIdx = i;
break;
}
}
if (originalPomFileIdx > -1) {
supportingFiles.remove(originalPomFileIdx);
}
supportingFiles.add(new SupportingFile("pom-j8-async.mustache", "", "pom.xml"));
}
return objs;