swagger-codegen-generators
swagger-codegen-generators copied to clipboard
ServiceImpl generated in bad package
Versions
1.0.25 - swagger-codegen-generators
3.0.25 - swagger-codegen-maven-plugin - generator jaxrs-resteasy-eap
Description
I generate java components from swagger with the jaxrs-resteasy-eap generator using swagger-codegen-maven-plugin maven plugin. The service implementation file aren't generated in the same package declaration and the project doesn't compile.
Steps to reproduce
- Configure the pom file on your project as below :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.25</version>
<dependencies>
<dependency>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-generators</artifactId>
<version>1.0.26-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi-demo.yaml</inputSpec>
<language>jaxrs-resteasy-eap</language>
<configOptions>
<sourceFolder>src/main/java</sourceFolder>
<dateLibrary>java8-localdatetime</dateLibrary>
<interfaceOnly>false</interfaceOnly>
<java8>true</java8>
<library>resteasy</library>
</configOptions>
<output>${project.build.directory}/generated-sources</output>
</configuration>
<executions>
<execution>
<id>generate-openapi</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<modelPackage>fr.example.demo.model</modelPackage>
<apiPackage>fr.example.demo.api</apiPackage>
<invokerPackage>fr.example.demo</invokerPackage>
<generateApis>true</generateApis>
<generateModels>true</generateModels>
<generateModelDocumentation>false</generateModelDocumentation>
<generateModelTests>true</generateModelTests>
<generateSupportingFiles>false</generateSupportingFiles>
<ignoreFileOverride>${project.basedir}/swagger-codegen-ignore</ignoreFileOverride>
</configuration>
</execution>
</executions>
</plugin>
- Generate the java code with
swagger-codegen-maven-pluginplugin andjaxrs-resteasy-eap generator(mvn clean install on your project)