gpt4 book ai didi

java - 包 javax.xml.stream 可从多个模块 : , java.xml 访问

转载 作者:行者123 更新时间:2023-12-02 10:56:08 25 4
gpt4 key购买 nike

我有编译错误:The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml .申请 maven install构建成功,但它不作为 java 应用程序运行。
CTRL + SHIFT + T 告诉我 javax.xml.stream包是 JDK-11 (Modulepath) 和 stax-api 的一部分(类路径)。stax-api是无法删除的父模块的依赖项。此问题出现在 Eclipse 2019-12、2020-03、2020-06 和 IntelliJ 以及不同版本的 Java 11 上。
到目前为止,我尝试为子项中的所有依赖项排除 javax.xml.stream<exclude>javax.xml.stream</exclude>但没有成功。
我该如何解决这个问题?

最佳答案

I tried so far to exclude javax.xml.stream for all dependencies within child<exclude>javax.xml.stream</exclude> but with no success.


不知道你是怎么排除的?我会说它应该在 pom.xml 中完成。与此类似:
<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>

关于java - 包 javax.xml.stream 可从多个模块 : <unnamed>, java.xml 访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63938809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com