Java 10:替换java.xml.ws冲突 [英] Java 10: Replacement for java.xml.ws conflict

查看:488
本文介绍了Java 10:替换java.xml.ws冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在我的项目中使用 java.xml.ws * 组件,但由于它已被弃用并且很快就会被删除,我想使用替换这些组件。所以我将这个依赖项添加到我的项目的 pom 文件中:

I have to use java.xml.ws* components in my project but because it's deprecated and will be removed soon I want to use replacement for these components. So I added this dependency to my project's pom file:

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.0</version>
    <type>pom</type>
</dependency>

这是我的模块配置:

module x.y.z {
    requires kotlin.stdlib;
    requires spring.boot;
    requires spring.boot.autoconfigure;
    requires spring.context;
    requires cxf.core;
    requires cxf.rt.frontend.jaxws;
    requires java.xml.ws;
}

但是有一个错误:

这是什么意思以及如何修复它以便我可以使用上面的依赖项代替 java.xml.ws 来自jdk?

What does it mean and how to fix it so I can use my dependency above instead of java.xml.ws from jdk?

推荐答案

使用Java 11 :)那里没有 javax.xml.ws 模块,所以没有冲突。

Just use Java 11 :) There is no javax.xml.ws module there, so no conflict.

至于Java 10,最简单的解决方法是将 jaxws-ri 的范围更改为运行时

As for Java 10, the easiest workaround is to change the scope of jaxws-ri to runtime:

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.0</version>
    <scope>runtime</scope>
</dependency>

这篇关于Java 10:替换java.xml.ws冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆