当我运行 mvn test
我收到这个警告。我该如何解决?
Found multiple occurrences of org.json.JSONObject on the class path:
jar:file:/C:/Users/Chloe/.m2/repository/org/json/json/20140107/json-20140107.jar!/org/json/JSONObject.class
jar:file:/C:/Users/Chloe/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class
You may wish to exclude one of them to ensure predictable runtime behavior
这是我的 pom.xml 。对 JSON 的唯一引用是
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
阿帕奇行家 3.5.3
原文由 Chloe 发布,翻译遵循 CC BY-SA 4.0 许可协议
添加在
以下排除:
同样,对于 Gradle 项目: