From 355e694fb221b7a2724cdc3222da2ac370dcfb34 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Tue, 15 Nov 2016 17:34:06 -0800 Subject: [PATCH] Add gitUseID and gitRepoID flags to maven plugin --- .../swagger/codegen/plugin/CodeGenMojo.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java index 1755e67750f..813762112d2 100644 --- a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java +++ b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java @@ -70,6 +70,18 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "inputSpec", required = true) private String inputSpec; + /** + * Git user ID, e.g. swagger-api. + */ + @Parameter(name = "gitUserId", required = false) + private String gitUserId; + + /** + * Git repo ID, e.g. swagger-codegen. + */ + @Parameter(name = "gitRepoId", required = false) + private String gitRepoId; + /** * Folder containing the template files. */ @@ -195,6 +207,14 @@ public class CodeGenMojo extends AbstractMojo { configurator.setInputSpec(inputSpec); } + if(isNotEmpty(gitUserId)) { + configurator.setGitUserId(gitUserId); + } + + if(isNotEmpty(gitRepoId)) { + configurator.setGitRepoId(gitRepoId); + } + configurator.setLang(language); configurator.setOutputDir(output.getAbsolutePath());