1

我正在开发一个项目并尝试从编译器版本迁移。从 JDK 1.7 到 1.8。在构建过程中,我在其中一个模块上收到了以下错误,但我无法解决它。

Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.6:wsimport (default) on project wae-client-jar: Invocation of com.sun.tools.ws.wscompile.WsimportTool failed - check output

我正在使用IntelliJ,我的Maven版本是3.6.3.

这是我的 pom.xml 的相关部分:

<plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wsdlDirectory>src/main/wsdl</wsdlDirectory>
                <packageName>com.company.wae.client.ebif.eps.sopi.wsdl</packageName>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.sun.xml.ws</groupId>
                    <artifactId>jaxws-rt</artifactId>
                    <version>2.2.10</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>2.1.6</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>2.1.6</version>
                </dependency>
                <dependency>
                    <groupId>com.company.wae.base</groupId>
                    <artifactId>wae-jboss-lib</artifactId>
                    <version>9.8.0</version>
                </dependency>
            </dependencies>
        </plugin>
</plugins>

到目前为止,我已经尝试过,

-更新插件配置如下

 <configuration>
        <wsdlDirectory>src/main/wsdl</wsdlDirectory>
        <packageName>com.company.wae.client.ebif.eps.sopi.wsdl</packageName>
        <vmArgs>
            <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
        </vmArgs>
    </configuration>

- 将 jaxws-maven-plugin 的版本更改为 2.4.1 并添加以下 dep。到插件

   <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-tools</artifactId>
        <version>2.2.10</version>
    </dependency>

- 不仅要构建该模块,还要构建整个项目。

- 从本地 repo m2 中删除 jaxws-maven-plugin 和 jaxws-tools 文件夹。

- 检查 JAVA_HOME 路径以查看是否指向 JDK1.8。检查项目SDK(JDK 1.8)

这些都是这里主要提到的。

这些都没有帮助。

4

1 回答 1

0

我能够通过修复使用时的错误来解决这个问题mvn install -e

  • 首先,我将jaxb-implandjaxb-xjc版本从升级2.1.62.2.10.

  • 我在下面添加了jaxb-core依赖jaxws-tools项。

这是我的 pom.xml 的更新部分:

<plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <wsdlDirectory>src/main/wsdl</wsdlDirectory>
                    <packageName>com.company.wae.client.ebif.eps.sopi.wsdl</packageName>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.ws</groupId>
                        <artifactId>jaxws-rt</artifactId>
                        <version>2.2.10</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.2.10</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.2.10</version>
                    </dependency>
                    <dependency>
                        <groupId>com.company.wae.base</groupId>
                        <artifactId>wae-jboss-lib</artifactId>
                        <version>9.8.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-core</artifactId>
                        <version>2.3.0.1</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.ws</groupId>
                        <artifactId>jaxws-tools</artifactId>
                        <version>2.2.10</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
于 2021-02-11T16:07:13.507 回答