![](/img/trans.png)
[英]How to make a synchronous call with WebClient using Open API Code Generator
[英]Open Api code generator maven plug in tag details
下面是我打開的 api 代碼 gen maven 插件
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.2.0</version>
<executions>
<execution>
<id>server</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<skipValidateSpec>true</skipValidateSpec>
<inputSpec>${project.basedir}/src/main/resources/games.yaml</inputSpec>
<generatorName>spring</generatorName>
<library>spring-boot</library>
<generateSupportingFiles>false</generateSupportingFiles>
<output>${project.build.directory}/generated-sources</output>
<apiPackage>com.tintin.api</apiPackage>
<modelPackage>com.tintin.model</modelPackage>
<configOptions>
<supportingFilesToGenrate>ApiUtil.java</supportingFilesToGenrate>
<interfaceOnly>true</interfaceOnly>
<delegatePattern>true</delegatePattern>
<dateLibrary>java8</dateLibrary>
<skipDefaultInterface>true</skipDefaultInterface>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
configuration 和 configOption 標簽之間有什么區別。 哪些選項可以放在哪些標簽內?
<configuration>
元素旨在為您的插件提供配置,即您的情況下的org.openapitools:openapi-generator-maven-plugin:xyz
。 <configuration>
元素是一個標准的插件標簽,旨在將插件配置封裝為一個整體。 它是一個通用元素,可以承載任何形狀的任何子元素,並且對所有插件都是通用的。
另一方面, <configOptions>
是一個插件,即org.openapitools:openapi-generator-maven-plugin:xyz
,聲明特定於插件本身的配置屬性的特定元素。 這是一個非標准標簽,必須映射到插件XXXMojo.java
類型中的特定字段。 在這里你可以看到映射:
public class CodeGenMojo extends AbstractMojo {
// other properties
/**
* A map of language-specific parameters as passed with the -c option to the command line
*/
@Parameter(name = "configOptions")
private Map<?, ?> configOptions;
// ...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.