Swagger CodeGen依赖性问题

时间:2018-12-18 14:24:35

标签: maven swagger swagger-codegen

我正在尝试使用Swagger codegen Maven plugin启动和运行一个项目。我的plugin中有以下pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>3.0.0-rc1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
                        <language>spring</language>
                        <configOptions>
                            <sourceFolder>src/gen/java/main</sourceFolder>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

当我运行mvn clean compile时,会遇到很多依赖错误。例如,fasterxmlthreeten。令我惊讶的是,这些依赖关系不会自动配置,并且一切都将立即可用。我是在做错什么,还是真的需要将依赖项手动添加到pom.xml

更新

在仔细阅读代码时,我注意到有一个生成的pom.xml(上面配置中的target/generated-sources/swagger)似乎具有我需要的依赖项。谷歌搜索导致关于我的问题的issue thread。看起来这是一个潜在的已知问题。

当我使用<language>jaxrs-resteasy</language>时,依赖项复制有效,但我仍在处理其他用例(我最初拥有的spring以及jaxrs-jersey)。

0 个答案:

没有答案
相关问题