Java 无法使用jersey2的Swagger codegen maven插件与jodatime一起生成模型

Java 无法使用jersey2的Swagger codegen maven插件与jodatime一起生成模型,java,maven,jodatime,jersey-2.0,swagger-codegen,Java,Maven,Jodatime,Jersey 2.0,Swagger Codegen,对maven swagger codegen插件使用以下配置: <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.2</version> &l

对maven swagger codegen插件使用以下配置:

        <plugin>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>2.2.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>${basedir}/src/main/resources/swagger.yaml</inputSpec>
                        <ignoreFileOverride>${basedir}/.swagger-codegen-ignore</ignoreFileOverride>
                        <language>jaxrs</language>
                        <library>jersey2</library>
                        <configOptions>
                            <sourceFolder>src/main/java</sourceFolder>
                            <apiPackage>com.github.jmccloskey.api</apiPackage>
                            <modelPackage>com.github.jmccloskey.model</modelPackage>
                            <invokerPackage>com.github.jmccloskey.invoker</invokerPackage>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>
我认为spi是Jersey1用于依赖注入的,而Jersey2使用hk2

通过向依赖项(以及其他一些依赖项,如抛弃、rome和javax.mail)添加jersey包,我能够解决编译失败的问题,但我的API中存在运行时问题:

2. java.lang.IllegalStateException: Unable to perform operation: method inject on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
3. java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.message.internal.MessageBodyFactory
混合Jersey 1依赖项不是正确的方法。 有没有办法将swagger codegen maven插件配置为使用hk2

有关完整的示例项目,请参见此。任何指向正确方向的指示都将不胜感激

.../JodaDateTimeProvider.java:[3,41] package com.sun.jersey.core.spi.component does not exist
2. java.lang.IllegalStateException: Unable to perform operation: method inject on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
3. java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.message.internal.MessageBodyFactory