mojohaus / jaxws-maven-plugin

https://www.mojohaus.org/jaxws-maven-plugin/
Apache License 2.0
25 stars 37 forks source link

Exception - java.lang.ClassNotFoundException: org.codehaus.mojo.jaxws.Invoker #90

Open lahirujayathilake opened 4 years ago

lahirujayathilake commented 4 years ago

I am using org.codehaus.mojo:jaxws-maven-plugin:2.6 to generate stub code using a WSDL and I am getting the error

[INFO] jaxws:wsimport args: [-keep, -s, 'C:\<path>\target\generated-sources\common\java', -d, 'C:\<path>\target\classes', -encoding, UTF-8, -extension, -Xnocompile, -XadditionalHeaders, -B-Xinheritance, -b, 'file:/C:/<path>/bindings.xml', "file:/C:/<path>/FiskalizacijaService.wsdl"] Error: Could not find or load main class org.codehaus.mojo.jaxws.Invoker Caused by: java.lang.ClassNotFoundException: org.codehaus.mojo.jaxws.Invoker

Maven plugin looks like

`

org.codehaus.mojo
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<dependencies>
    <dependency>
        <groupId>org.jvnet.jaxb2_commons</groupId>
        <artifactId>jaxb2-basics</artifactId>
        <version>0.6.4</version>
    </dependency>
</dependencies>
<executions>
    <execution>
        <!-- another execution -->
    </execution>
    <execution>
        <id>add-source</id>
        <goals>
            <goal>wsimport</goal>
        </goals>
        <configuration>
            <xjcArgs>
                <xjcArg>-Xinheritance</xjcArg>
            </xjcArgs>
            <bindingFiles>
                <bindingFile>${basedir}/resources/schema/bindings.xml</bindingFile>
            </bindingFiles>
            <vmArgs>
                <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
            </vmArgs>
            <extension>true</extension>
            <wsdlFiles>
                <wsdlFile>${basedir}/resources/schema/Service.wsdl</wsdlFile>
            </wsdlFiles>
            <keep>true</keep>
            <xadditionalHeaders>true</xadditionalHeaders>
            <sourceDestDir>${project.build.directory}/generated-sources/common/java</sourceDestDir>
        </configuration>
    </execution>
</executions>

`

This works in JDK 8 but doesn't work with the JDK9

slawekjaranowski commented 10 months ago

https://stackoverflow.com/questions/66156996/invocation-of-com-sun-tools-ws-wscompile-wsimporttool-failed-error-during-comp