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

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

使用springboot遇到问题

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

同类名引起冲突,通过下面方式排出冲突。

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

参考:https://stackoverflow.com/questions/52980064/maven-spring-boot-found-multiple-occurrences-of-org-json-jsonobject-on-the-cl

目录
相关文章
|
6月前
|
人工智能 机器人 测试技术
【CMake报错】报错:Flow control statements are not properly nested.
【CMake报错】报错:Flow control statements are not properly nested.
|
6月前
|
设计模式 人工智能 Java
Error: JavaFX runtime components are missing, and are required to run this application with Gradle e
Error: JavaFX runtime components are missing, and are required to run this application with Gradle e
231 1
|
6月前
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
95 0
|
6月前
|
JavaScript 程序员 Swift
The compiler is unable to type-check this expression in reasonable time; try breaking up the express
The compiler is unable to type-check this expression in reasonable time; try breaking up the express
67 0
|
6月前
Classic mode for store/ is deprecated and will be removed in Nuxt 3
Classic mode for store/ is deprecated and will be removed in Nuxt 3
106 0
|
11月前
Error: Plugin/Preset files are not allowed to export objects, only functions……
Error: Plugin/Preset files are not allowed to export objects, only functions……
|
开发工具
WARNING: library configuration mismatch
WARNING: library configuration mismatch
299 0
No matching configuration of project :libusb was found.
No matching configuration of project :libusb was found.
606 0
Manifest merger failed with multiple errors, see logs
Manifest merger failed with multiple errors, see logs
121 0
|
Java 测试技术
出现Error creating bean with name与CONDITIONS EVALUATION REPORT问题
出现Error creating bean with name与CONDITIONS EVALUATION REPORT问题
349 0
出现Error creating bean with name与CONDITIONS EVALUATION REPORT问题