3

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:

    <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>

My dependencies:

<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>
            <!--            exclude for IQ Gate report-->
            <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>

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?

LunaticJape
  • 1,446
  • 4
  • 21
  • 39
  • I would check which jar is including those classes, then check dependencies hierarchy, to see who import the jar and then decide if something needs to be updated or excluded. With Eclipse there's a plugin that can help you through these steps, else if you post all your pom.xml I can check further. – WoAiNii May 05 '20 at 07:06

0 Answers0