using swagger-codegen-maven-plugin without spring-boot dependency

Viewed 1842

I have requirement to generate rest api using swagger. I have written yaml files for generating Rest API. In my pom.xml i have

Blockquote

`<build>
        <plugins>
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>2.2.2</version>
                <executions>
                    <execution>
                        <id>sample-api</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>src/main/resources/swagger.yaml</inputSpec>
                            <output>src/test/java</output>
                            <language>spring</language>
                             <configOptions>
                               <sourceFolder>/</sourceFolder>
                            </configOptions>
                            <apiPackage>io.swagger.handler</apiPackage>
                            <modelPackage>io.swagger.model</modelPackage>
                            <invokerPackage>io.swagger.handler</invokerPackage>
                        </configuration>
                    </execution>
              </executions>
            </plugin>
        </plugins>
    </build>`

but when i execute "mvn clean install" it asks me to provide org.springframework.boot dependency. Is there any way i can use this plugin without spring-boot dependency?

1 Answers
  <!-- SWAGGER -->
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>2.2.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${basedir}/swagger.yaml</inputSpec>
                            <language>spring</language>
                            <output>${basedir}</output>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
Related