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

目录
相关文章
|
7月前
|
Kubernetes 容器
error: no configuration has been provided, try setting KUBERNET
error: no configuration has been provided, try setting KUBERNET
71 0
|
7月前
|
设计模式 人工智能 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
242 1
|
7月前
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
103 0
|
7月前
|
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
71 0
|
7月前
|
JavaScript
解决报错did you register the component correctly? For recursive components, make sure to provide the “na
解决报错did you register the component correctly? For recursive components, make sure to provide the “na
|
7月前
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
114 0
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
317 0
|
Java Scala
sbt.internal.inc.CompileFailed: Error compiling the sbt component ‘compiler-interface-2.11.8-61.0‘
IDEA 的 JDK 和 Scala 版本对应不上。 使用 Scala12.1.8配上 JDK8
502 0
No matching configuration of project :libusb was found.
No matching configuration of project :libusb was found.
612 0