Cxf codegen plugin 指定cxf codegen插件使用的JAXB/XJC版本

Cxf codegen plugin 指定cxf codegen插件使用的JAXB/XJC版本,cxf-codegen-plugin,java,jaxb,cxf,xjc,Cxf Codegen Plugin,Java,Jaxb,Cxf,Xjc,我正在使用生成代码。当前版本(3.2.4)使用JAXB/XJC版本2.2.11 如何将使用过的JAXB/XJC升级到更高版本,例如2.3.0? 以下是我迄今为止所尝试的: <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <

我正在使用生成代码。当前版本(
3.2.4
)使用JAXB/XJC版本
2.2.11

如何将使用过的JAXB/XJC升级到更高版本,例如2.3.0?

以下是我迄今为止所尝试的:

        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${project.basedir}/src/main/resources/main.wsdl</wsdl>
                        <bindingFiles>
                            <bindingFile>${project.basedir}/src/main/resources/bindings.xjb</bindingFile>
                            <bindingFile>${project.basedir}/src/main/resources/wsdl-bindings.xjb</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-core</artifactId>
                    <version>2.3.0</version>
                </dependency>
            </dependencies>
        </plugin>

因此,我不确定版本
2.3.0
是否被接受。

根据您向我们展示的,版本
2.3.0
可能被接受。尽管看起来
jaxb
依赖项具有指向
2.2.11
的可传递依赖项。您可以做的是运行
mvn dependency:tree
命令,查看出现版本
2.2.11
的确切位置,然后尝试排除them@DamCx不,没有从
2.3.0
2.2.11
的可传递依赖项。那么
mvn依赖项:tree
命令呢?@DamCx我运行了它,这就是为什么我知道从
2.3.0
2.2.11
没有可传递的依赖关系。然而,
mvn-dependency:tree
只显示给定项目的依赖关系,而不是一些使用过的Maven插件的依赖关系。我已经检查了
com.sun.xml.bin:jaxb-*
的依赖项,方法是直接将它们添加为项目的依赖项。不确定如何检查
cxf codegen插件的有效依赖关系。请对插件使用以下命令:
mvn依赖关系:解析插件
。它可能有点长,但应该可以完成这项工作。
[WARNING] The POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details