diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 9748847c414b..1623cfeeeba4 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -216,6 +216,33 @@ Specifying a custom generator is a bit different. It doesn't support the classpa ``` +## Example: Generate a Java client using the Maven plugin + +If you want to generate a Java client from an OpenAPI spec as part of your Maven build, you can use the plugin like this. + +Here’s a simple example that reads an OpenAPI YAML file and generates the client code into the `target` folder: + +```xml + + org.openapitools + openapi-generator-maven-plugin + 7.5.0 + + + + generate + + + + + ${project.basedir}/src/main/resources/openapi.yaml + java + ${project.build.directory}/generated-sources/openapi + com.example.api + com.example.model + com.example.invoker + + ### Sample configuration