我已经将web服务定义编写为OpenAPI文档。我使用的openapi-generator-maven-plugin总是生成一个包含pom和gradle构建脚本的整个项目,但我只需要生成pojos,也许还需要生成API客户端。它应该与JaxB或JaxWS代码生成器同等工作。
那么有没有办法让插件只生成Java代码呢?也许有另一个插件可以做这项工作?
下面是我的配置:
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.1.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/my-api.yaml</inputSpec>
<modelPackage>com.my.path.to.api</modelPackage>
<generatorName>java</generatorName>
<generateApis>false</generateApis>
<generateModels>true</generateModels>
<generateModelDocumentation>false</generateModelDocumentation>
<generateModelTests>false</generateModelTests>
<library>vertx</library>
<configOptions>
<sourceFolder>src/main/java</sourceFolder>
<dateLibrary>java8</dateLibrary>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>发布于 2021-04-08 14:57:37
https://stackoverflow.com/questions/66998283
复制相似问题