swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

System properties are not properly reset by maven plugin

Open heapoutofspace opened this issue 9 years ago • 1 comments

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)

heapoutofspace avatar Mar 22 '17 08:03 heapoutofspace

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.

ePaul avatar Mar 22 '17 10:03 ePaul