Skip to content

Commit e289b85

Browse files
committed
Merge pull request #1428 from swagger-api/feature/selective-generation
made selective generation of models
2 parents bbb59f9 + 7170f7f commit e289b85

File tree

2 files changed

+221
-138
lines changed

2 files changed

+221
-138
lines changed

modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import config.ConfigParser;
3737

3838
import java.io.File;
39+
import java.util.HashMap;
3940
import java.util.Map;
4041
import java.util.ServiceLoader;
4142

@@ -112,6 +113,9 @@ public class CodeGenMojo extends AbstractMojo {
112113
@Parameter(defaultValue = "true")
113114
private boolean addCompileSourceRoot = true;
114115

116+
@Parameter
117+
protected Map<String, String> environmentVariables = new HashMap<String, String>();
118+
115119
/**
116120
* The project being built.
117121
*/
@@ -125,6 +129,12 @@ public void execute() throws MojoExecutionException {
125129
CodegenConfig config = CodegenConfigLoader.forName(language);
126130
config.setOutputDir(output.getAbsolutePath());
127131

132+
if (environmentVariables != null) {
133+
for(String key : environmentVariables.keySet()) {
134+
System.setProperty(key, environmentVariables.get(key));
135+
}
136+
}
137+
128138
if (null != templateDirectory) {
129139
config.additionalProperties().put(TEMPLATE_DIR_PARAM, templateDirectory.getAbsolutePath());
130140
}

0 commit comments

Comments
 (0)