We have a spring boot multi module maven project.
We would like to have controller/delegates in one module and models in another module. (eg: myproject-web, myproject-data etc.. ).
When we generate the classes using the plugin openapi-generator-maven-plugin, we would like to generate the controller and delegates in myproject-web and model classes in myproject-data.
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.4.0</version>
<executions>
<execution>
<id>myproject-api</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>
${project.basedir}/src/main/resources/specs/myproject-api-spec.yaml
</inputSpec>
<output>${project.basedir}myproject-datasrcmainjava</output>
<!-- <output>
../../myproject-data/src/main/java
</output>-->
<!--<output>
C:ProjectsABCmyprojectservicemyproject-parentmyproject-datasrcmainjava
</output>-->
<generatorName>spring</generatorName>
<modelPackage>com.abc.myproject.common.model</modelPackage>
<apiPackage>com.abc.myproject.web.controller</apiPackage>
<!--<skipIfSpecIsUnchanged>true</skipIfSpecIsUnchanged>-->
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<additionalModelTypeAnnotations>
@lombok.Data
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
</additionalModelTypeAnnotations>
<dateLibrary>java8</dateLibrary>
<delegatePattern>true</delegatePattern>
<documentationProvider>springdoc</documentationProvider>
<unhandledException>true</unhandledException>
<openApiNullable>true</openApiNullable>
<useSpringBoot3>true</useSpringBoot3>
<output></output>
</configOptions>
<output>.</output>
<ignoreFileOverride>${project.basedir}/.openapi-generator-ignore
</ignoreFileOverride>
<templateDirectory>${project.basedir}/templates</templateDirectory>
</configuration>
</execution>
</executions>
</plugin>
We tried, using output directory configuration for the same but its not working.
Any idea, how this can be addressed.