Apache CXF仍在生成的代码中使用旧的依赖。

huangapple 未分类评论51阅读模式
英文:

apache cxf is still using the old dependency in the generated code

问题

我正在使用Java 11和Apache CXF 3.3.5,它应该支持Java 11。但是一些生成的类仍然在导入javax.xml.ws,而这在Java 11中已被移除。

我的插件配置:

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>uapi-stub-client</id>
            <phase>generate-sources</phase>
            <configuration>
                <additionalJvmArgs>
                    -Djavax.xml.accessExternalSchema=all
                </additionalJvmArgs>
                <sourceRoot>${SRC_BINDING_DIR}</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${WSDL_FILE_QUEUE}</wsdl>
                        <extraargs>
                            <extraarg>-verbose</extraarg>
                            <extraarg>-b</extraarg>
                            <extraarg>${WSDL_ASYNC_BINDINGX}</extraarg>
                        </extraargs>
                    </wsdlOption>
                    <wsdlOption>
                        <wsdl>${WSDL_FILE_SCHEDULER}</wsdl>
                        <extraargs>
                            <extraarg>-verbose</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

我的依赖配置:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-jaxws</artifactId>
    <version>${cxf.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-ws-policy</artifactId>
    <version>${cxf.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-tools-common</artifactId>
    <version>${cxf.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-ws-security</artifactId>
    <version>${cxf.version}</version>
    <!-- 排除以供 IQ Gate 报告 -->
    <exclusions>
        <exclusion>
            <artifactId>ehcache</artifactId>
            <groupId>net.sf.ehcache</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>${cxf.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <type>maven-plugin</type>
</dependency>

在有效的POM中,我能够看到适用于Java 11的jakarta.xml.ws和其他相关库。我的POM中是否存在任何错误配置?

英文:

I'm using java 11 and apache cxf 3.3.5, which supposes to support the java 11. But some generated classes are still importing javax.xml.ws instead of , which has been removed from java 11.

My plugin:

    &lt;plugin&gt;
        &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
        &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
        &lt;version&gt;${cxf.version}&lt;/version&gt;
        &lt;executions&gt;
            &lt;execution&gt;
                &lt;id&gt;uapi-stub-client&lt;/id&gt;
                &lt;phase&gt;generate-sources&lt;/phase&gt;
                &lt;configuration&gt;
                    &lt;additionalJvmArgs&gt;
                        -Djavax.xml.accessExternalSchema=all
                    &lt;/additionalJvmArgs&gt;
                    &lt;sourceRoot&gt;${SRC_BINDING_DIR}&lt;/sourceRoot&gt;
                    &lt;wsdlOptions&gt;
                        &lt;wsdlOption&gt;
                            &lt;wsdl&gt;${WSDL_FILE_QUEUE}&lt;/wsdl&gt;
                            &lt;extraargs&gt;
                                &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                                &lt;extraarg&gt;-b&lt;/extraarg&gt;
                                &lt;extraarg&gt;${WSDL_ASYNC_BINDINGX}&lt;/extraarg&gt;
                            &lt;/extraargs&gt;
                        &lt;/wsdlOption&gt;
                        &lt;wsdlOption&gt;
                            &lt;wsdl&gt;${WSDL_FILE_SCHEDULER}&lt;/wsdl&gt;
                            &lt;extraargs&gt;
                                &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                            &lt;/extraargs&gt;
                        &lt;/wsdlOption&gt;
                    &lt;/wsdlOptions&gt;
                &lt;/configuration&gt;
                &lt;goals&gt;
                    &lt;goal&gt;wsdl2java&lt;/goal&gt;
                &lt;/goals&gt;
            &lt;/execution&gt;
        &lt;/executions&gt;
    &lt;/plugin&gt;

My dependencies:

&lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-rt-ws-policy&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-tools-common&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-rt-ws-security&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
            &lt;!--            exclude for IQ Gate report--&gt;
            &lt;exclusions&gt;
                &lt;exclusion&gt;
                    &lt;artifactId&gt;ehcache&lt;/artifactId&gt;
                    &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
                &lt;/exclusion&gt;
            &lt;/exclusions&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
            &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
            &lt;version&gt;${cxf.version}&lt;/version&gt;
            &lt;type&gt;maven-plugin&lt;/type&gt;
        &lt;/dependency&gt;

In the effective pom, I'm able to see the jakarta.xml.ws and other related libs for java 11. Are there any misconfiguration in my pom?

huangapple
  • 本文由 发表于 2020年5月5日 08:51:52
  • 转载请务必保留本文链接:https://java.coder-hub.com/61604022.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定