单元测试错误Found multiple occurrences of org.json.JSONObject on the class path

编译错误

单元测试启动错误

bash 复制代码
Found multiple occurrences of org.json.JSONObject on the class path:

	jar:file:/D:/developsoft/maven/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class
	jar:file:/D:/developsoft/maven/repository/org/json/json/20131018/json-20131018.jar!/org/json/JSONObject.class

You may wish to exclude one of them to ensure predictable runtime behavior

分析:依赖冲突

解决办法:排除依赖

xml 复制代码
 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
相关推荐
Cv打怪升级38 分钟前
3D-Front数据集 json说明
3d·json
电商API&Tina15 小时前
【电商API接口】关于电商数据采集相关行业
java·python·oracle·django·sqlite·json·php
汽车仪器仪表相关领域15 小时前
GZCVL T-II 安全防坠器测试系统
功能测试·测试工具·安全·单元测试·压力测试·可用性测试
天远数科17 小时前
Go语言金融风控:天远 全能小微企业报告组合接口的 AES 加密与异构 JSON 解析
大数据·golang·json
小明的小名叫小明20 小时前
Solidity入门(14)-Hardhat 3 单元测试基础与技巧
单元测试·区块链·solidity·hardhat
音浪豆豆_Rachel1 天前
Flutter跨平台通信的实战演练:复杂数据结构与单元测试在鸿蒙生态中的完美实现
数据结构·flutter·单元测试·harmonyos
白露与泡影1 天前
Java单元测试、集成测试,区别
java·单元测试·集成测试
汽车仪器仪表相关领域1 天前
ZRT-V 机器人减速器寿命测试系统:精准破解 “寿命焦虑” 的核心测试方案
人工智能·功能测试·机器学习·单元测试·机器人·可用性测试·安全性测试
盼哥PyAI实验室1 天前
Python 爬虫核心基础:请求与响应机制全解析(从 GET 请求到 JSON 分页实战)
爬虫·python·json
陌颜39111 天前
JSON在线工具:从数据混沌到清晰洞察的智能助手
json