swagger-codegen
swagger-codegen copied to clipboard
System properties are not properly reset by maven plugin
Description
Some selective generation options, such as generateModels, remain set for multiple successive plugin executions, even when explicitly set to false.
Swagger-codegen version
latest 2.2.3-SNAPSHOT
Steps to reproduce
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateModels>true</generateModels>
</configuration>
</execution>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateModels>false</generateModels>
</configuration>
</execution>
</executions>
</plugin>
Suggest a Fix
Properly reset system properties when options are set to false. (Pull requests follows)
Properly reset system properties when options are set to false. (Pull requests follows)
As discussed in #4788, I think the proper way of solving this would be to not use system properties to pass those parameters. But I guess this here is a stop-gap measure to work until this is done.