From f6e145f7acb6ed09c76c446236bbdfb436f9ee85 Mon Sep 17 00:00:00 2001 From: Naveenkumarsuk Date: Sat, 19 Jul 2025 10:45:53 +0100 Subject: [PATCH] Add example for generating Java client using Maven plugin --- .../openapi-generator-maven-plugin/README.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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