下面是我打開的 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 標簽之間有什么區別。哪些選項可以放在哪些標簽內?
uj5u.com熱心網友回復:
這些<configuration>元素旨在為您的插件提供配置,即org.openapitools:openapi-generator-maven-plugin:x.y.z您的情況。該<configuration>元素是一個標準的插件標簽,旨在將插件配置封裝為一個整體。它是一個通用元素,可以承載任何形狀的任何子元素,并且對所有插件都是通用的。
在<configOptions>另一方面是一個插件,即org.openapitools:openapi-generator-maven-plugin:x.y.z,宣告配置屬性特定于插件它自,特定元素。這是一個非標準標簽,必須映射到插件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;
// ...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/323001.html
