Skip to content

Instantly share code, notes, and snippets.

@splatch
Created November 19, 2020 16:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splatch/bbe62afdbfe3cf41221c0794620bc0fd to your computer and use it in GitHub Desktop.
Save splatch/bbe62afdbfe3cf41221c0794620bc0fd to your computer and use it in GitHub Desktop.
Fragment of maven plugin configuration to get jaxrs stubs out of openapi generator plugin.
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.3.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<inputSpec>${project.basedir}/src/main/openapi/v1/openapi.yaml</inputSpec>
<generatorName>jaxrs-spec</generatorName>
<output>${project.build.directory}/openapi</output>
<strictSpec>true</strictSpec>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<returnResponse>false</returnResponse>
<generatePom>false</generatePom>
<useSwaggerAnnotations>false</useSwaggerAnnotations>
</configOptions>
<apiPackage>cloud.connectorio.services.core.asset.resources.v1</apiPackage>
<modelPackage>cloud.connectorio.services.core.asset.resources.v1.model</modelPackage>
<generateModelTests>false</generateModelTests>
<generateApiTests>false</generateApiTests>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
</execution>
</executions>
<configuration>
<sources>
<source>${project.build.directory}/openapi/src/gen/java</source>
</sources>
</configuration>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment