Search code examples
openapiopenapi-generatoropenapi-generator-maven-plugin

How to skip generation of ".openapi-generator" folder when using openapi-generator?


I am not able in any way to skip openapi-generator maven plugin version 5.3.0 from generating ".openapi-generator" folder.

        <plugin>
            <groupId>org.openapitools</groupId>
            <artifactId>openapi-generator-maven-plugin</artifactId>
            <version>5.3.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <generateSupportingFiles>false</generateSupportingFiles>
                        <output>${REDACTED}</output>
                        <apiPackage>${REDACTED}</apiPackage>
                        <modelPackage>${REDACTED}</modelPackage>
                        <templateDirectory>${REDACTED}</templateDirectory>
                        <ignoreFileOverride>${PATH_TO_MY_FILE}</ignoreFileOverride>
                        <inputSpec>${REDACTED}</inputSpec>
                        <modelNameSuffix>REDACTED</modelNameSuffix>
                        <generatorName>java-vertx-web</generatorName>
                    </configuration>
                </execution>
            </executions>
        </plugin>

I have tried using ".openapi-generator-ignore" with all sorts of options including:

  • .openapi-generator/*
  • .openapi-generator/**
  • .openapi-generator/
  • and even **/*sha256 to try and ignore a single file that is there currently

I have other ignored files on my list so I know it is used.

Is there a way to prevent those meta files from being generated?


Solution

  • It turns out that this file is generated at the maven-plugin level and is hard-coded to be generated.
    See source code.

    There is no supported way to skip it's generation currently.

    A possible option is creating your own plugin copied from openapi-generator-maven-plugin and remove the unwanted files generation.