如何为swagger-codegen-maven-plugin传入--resolve-fully参数?
--resolve-fully to swagger-codegen-maven-plugin Hey Fredrik, I’ve got you sorted on this! The --resolve-fully command-line flag you use with the standalone CLI maps directly to a camelCase configuration parameter in the Maven plugin. Here's exactly how to update your setup to include it:
Updated Plugin Configuration
Add the <resolveFully>true</resolveFully> line inside the <configuration> section of your plugin execution. This tells the codegen to fully resolve all referenced models—including those inline responses like InlineResponse200 that you’re currently missing:
<plugin> <groupId>io.swagger.codegen.v3</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>3.0.21</version> <executions> <execution> <id>deviceagent-client-interface</id> <goals> <goal>generate</goal> </goals> <configuration> <!-- the json-file --> <inputSpec>${basedir}/src/main/resources/da_2.json</inputSpec> <!-- target to generate java client code --> <language>java</language> <!-- the output dir --> <output>${basedir}</output> <!-- the config file --> <configurationFile>${basedir}/src/main/resources/da_2_options.json</configurationFile> <!-- Equivalent to --resolve-fully flag in CLI --> <resolveFully>true</resolveFully> </configuration> </execution> </executions> </plugin>
Why This Works
Maven plugin parameters follow a simple conversion rule: kebab-case command-line flags (like --resolve-fully) become camelCase (resolveFully) in XML configuration. Enabling this ensures all nested or referenced schema definitions are fully expanded and generated as distinct classes, instead of being skipped or inlined.
After updating your pom.xml, run mvn generate-sources (or your regular build command) and you should see all the missing classes like InlineResponse200 show up in your generated output.
内容的提问来源于stack exchange,提问作者user2902165

