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 805afe22a94..22726c84c04 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 @@ -131,7 +131,12 @@ public class CodeGenMojo extends AbstractMojo { if (environmentVariables != null) { for(String key : environmentVariables.keySet()) { - System.setProperty(key, environmentVariables.get(key)); + String value = environmentVariables.get(key); + if(value == null) { + // don't put null values + value = ""; + } + System.setProperty(key, value); } }