[英]The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
I have compilation error: The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
.我有编译错误:
The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
。 Application with maven install
build succesfully but it doesn't run as java application.使用
maven install
构建成功的应用程序,但它不能作为 Java 应用程序运行。
CTRL + SHIFT + T shows me that javax.xml.stream
package is a part of JDK-11 (Modulepath) and stax-api
(Classpath). CTRL + SHIFT + T 告诉我
javax.xml.stream
包是 JDK-11 (Modulepath) 和stax-api
(Classpath) 的一部分。 stax-api
is a dependency of parent module which cannot be deleted. stax-api
是无法删除的父模块的依赖项。 This problem occurs on Eclipse 2019-12, 2020-03, 2020-06 and IntelliJ and different versions of Java 11.此问题发生在 Eclipse 2019-12、2020-03、2020-06 和 IntelliJ 以及不同版本的 Java 11 上。
I tried so far to exclude javax.xml.stream for all dependencies within child <exclude>javax.xml.stream</exclude>
but with no success.到目前为止,我尝试为子
<exclude>javax.xml.stream</exclude>
所有依赖项排除 javax.xml.stream,但没有成功。
How can I resolve this issue?我该如何解决这个问题?
I tried so far to exclude javax.xml.stream for all dependencies within child
<exclude>javax.xml.stream</exclude>
but with no success.到目前为止,我尝试为子
<exclude>javax.xml.stream</exclude>
所有依赖项排除 javax.xml.stream,但没有成功。
Not sure how you did the exclusion?不知道你是如何排除的? I would say it should be done in pom.xml.
我会说它应该在 pom.xml 中完成。 Similar to this:
与此类似:
<dependency>
<groupId>A_GROUP_ID</groupId>
<artifactId>AN_ARTIFACT_ID</artifactId>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.