Thank you!
Satender Kumar Mall
Twitter: @satenderiiit
source:internet |
<properties>
<jsonFilePath>src/main/resources/dev/1.0.0/xyz.yaml</jsonFilePath>
</properties>
<build> <plugins> <plugin>
<groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>${swagger-codegen-maven-plugin-version}</version> <executions> <execution> <id>generate-api</id> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${jsonFilePath}</inputSpec> <language>spring</language> <output>${project.build.directory}/generated-sources/swagger</output> <apiPackage>com.abc.swagger.api</apiPackage> <modelPackage>com.abc.swagger.model</modelPackage> <invokerPackage>com.abc.swagger.invoker</invokerPackage> <environmentVariables> <dateLibrary>java8</dateLibrary> <models/> <apis/> <supportingFilesToGenerate>SwaggerDocumentationConfig.java,HomeController.java </supportingFilesToGenerate> </environmentVariables> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-clean-plugin</artifactId> <executions> <execution> <id>clean-additional-generated-files</id> <phase>generate-sources</phase> <goals> <goal>clean</goal> </goals> <configuration> <excludeDefaultDirectories>true</excludeDefaultDirectories> <filesets> <fileset> <directory>${project.build.directory}/generated-sources/swagger</directory> <excludes> <exclude>src/main/java/**</exclude> </excludes> <followSymlinks>false</followSymlinks> </fileset> </filesets> </configuration> </execution> </executions> </plugin>
</plugins> </build>
source: internet |