0

I have problem with build with wsdl2java on java 11 jdk. It returns me this error :

[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.3.6:wsdl2java (generate-sources) on project dhl-wc: Execution generate-sources of goal org.apach
e.cxf:cxf-codegen-plugin:3.3.6:wsdl2java failed: Plugin org.apache.cxf:cxf-codegen-plugin:3.3.6 or one of its dependencies could not be resolved: Could not find ar
tifact sun.jdk:tools:jar:1.5.0 at specified path C:\Apps\jdk-11.0.13_windows-x64_bin\jdk-11.0.13/../lib/tools.jar -> [

Maven pom conf is :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.dhl.webcommon</groupId>
    <artifactId>dhl-wc</artifactId>
    <version>1.3.3.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>dhl-wc</name>
    <description>Library for DHL web projects</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>5.3.18</spring.version>
        <spring.security.version>4.2.17.RELEASE</spring.security.version>
        <spring.batch.version>3.0.10.RELEASE</spring.batch.version>

        <wicket.version>8.8.0</wicket.version>
        <wicketstuff.version>8.8.0</wicketstuff.version>
        <wicket-select2.version>4.1</wicket-select2.version>
        <wicket-bean-validation.version>8.8.0</wicket-bean-validation.version>
        <wicket-jquery-ui.version>8.8.0</wicket-jquery-ui.version>

        <joda.hibernate.version>1.4</joda.hibernate.version>
        <common.dbcp>1.4</common.dbcp>
        <org.jadira.usertype>2.0.1</org.jadira.usertype>

        <casclient>2.1.1</casclient>
        <org.apache.poi>4.1.2</org.apache.poi>
        <icu4j>67.1</icu4j>
        <aspectj>1.9.5</aspectj>
        <cxf-codegen-plugin.version>3.3.6</cxf-codegen-plugin.version>
        <cxf.version>3.3.6</cxf.version>
        <saml.filter.version>1.0.10.0</saml.filter.version>

        <jackson.version>2.9.4</jackson.version>
        <commons-io>2.6</commons-io>
        <commons-codec>1.14</commons-codec>
        <log4j>2.13.3</log4j>

        <!--        <flywayVersion>6.4.4</flywayVersion> TODO migrate to newer version-->
        <flywayVersion>4.0.3</flywayVersion>
        <hsqldb.version>2.5.0</hsqldb.version>
        <junit.version>4.13</junit.version>

        <dhl.dbc.dao.version>1.1.2.0-SNAPSHOT</dhl.dbc.dao.version>
        <dhl.resources.version>1.1.160.0</dhl.resources.version>
        <cdmConfigInMemoryDaoVersion>1.0.14.0</cdmConfigInMemoryDaoVersion>
        <cdmConfigWrapperEntities>1.0.13.0</cdmConfigWrapperEntities>
    </properties>

    <scm>
        

 <build>

        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>${basedir}/src/test/resources</directory>
            </testResource>
        </testResources>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <inherited>true</inherited>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <sourcepath>${basedir}/dummy</sourcepath>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!-- JUnit 5 requires Surefire version 2.22.0 or higher -->
                <version>3.0.0-M6</version>
            </plugin>

            <!-- WSDL -> Java (start) -->
            <plugin>
                <!-- !!! READ !!! -->
                <!-- mvn cxf-codegen-plugin:wsdl2java NOT working, comment phase and
                    run "mvn clean process-resources") -->
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf-codegen-plugin.version}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/UserManagementWs.wsdl</wsdl>
                                    <extraargs>
                                        <extraarg>-verbose</extraarg>
                                        <extraarg>-p</extraarg>
                                        <extraarg>com.dhl.common.service.ws.gen</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.woodstox</groupId>
                        <artifactId>stax2-api</artifactId>
                        <version>3.1.1</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-xjc-ts</artifactId>
                        <version>2.2.12</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-basics-jaxb-xjc</artifactId>
                        <version>2.1.13</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <url>http://czcholstc000112.prg-dc.dhl.com:8272/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>http://czcholstc000112.prg-dc.dhl.com:8272/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring.security.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-aop</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-beans</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-context</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-expression</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-expression</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-aop</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-context</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-core</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.security.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>org.springframework.security</artifactId>
                    <groupId>spring-security-core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-beans</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-context</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-expression</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.springframework</artifactId>
                    <groupId>spring-web</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-web</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-expression</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-context</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-core</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
     

Can someone give a point how to solve this issue? WSDL2JAVA plugin seems not to be outdated.I find some questions on this problem, but there is not question solving this problem. When I try to build this project on java 1.8, build runs smoothly. Thank you

Petr Kostroun
  • 456
  • 9
  • 27
  • No, this is problem with checkstyle plugin, and I have problem with WSDL2JAVA plugin. – Petr Kostroun Apr 11 '22 at 11:35
  • 1
    The answer still is the same. Update the particular software to a version that does not incorrectly assume that there has to be a `tools.jar`. – Holger Apr 11 '22 at 14:26

0 Answers0