【发布时间】:2017-07-21 14:01:18
【问题描述】:
我需要使用 swagger 生成 rest api。我已经编写了用于生成 Rest API 的 yaml 文件。在我的 pom.xml 我有
块引用
`<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>`
但是当我执行“mvn clean install”时,它要求我提供 org.springframework.boot 依赖项。有什么方法可以在没有 spring-boot 依赖的情况下使用这个插件?
【问题讨论】: