Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate JSON dependency #2637

Open
jusabatier opened this issue Oct 19, 2022 · 2 comments
Open

Duplicate JSON dependency #2637

jusabatier opened this issue Oct 19, 2022 · 2 comments

Comments

@jusabatier
Copy link

When running tests, they complains about duplicate org.json.JSONObject classes :

Found multiple occurrences of org.json.JSONObject on the class path:

jar:file:/home/jusabatier/.m2/repository/org/json/json/20211205/json-20211205.jar!/org/json/JSONObject.class
jar:file:/home/jusabatier/.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

I think you should exclude one of them.

@sebr72
Copy link
Contributor

sebr72 commented May 30, 2023

Could you please clarify how to reproduce the problem (where tests complains appears) ?

@jusabatier
Copy link
Author

I have this running tests on a springboot web application that embed mapfih-print lib.

Generate a dependency tree, it appear that :

[INFO] +- org.mapfish.print:print-lib:jar:3.29.4:compile
[INFO] |  +- com.thetransactioncompany:cors-filter:jar:2.10:compile
[INFO] |  |  \- com.thetransactioncompany:java-property-utils:jar:1.16:compile
[INFO] |  +- com.vladmihalcea:hibernate-types-52:jar:2.14.1:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.13.4:compile
[INFO] |  +- com.mchange:c3p0:jar:0.9.5.5:compile
[INFO] |  |  \- com.mchange:mchange-commons-java:jar:0.2.19:compile
[INFO] |  +- org.springframework:spring-orm:jar:5.3.23:compile
[INFO] |  +- org.springframework:spring-tx:jar:5.3.23:compile
[INFO] |  +- org.springframework:spring-test:jar:5.3.23:compile
[INFO] |  +- com.google.guava:guava:jar:31.0.1-jre:compile
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.7.1:compile
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  +- ch.qos.logback:logback-access:jar:1.2.11:compile
[INFO] |  |  \- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] |  +- org.json:json:jar:20211205:compile <=========================== HERE

Duplicates this one for tests :

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.4:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] |  +- org.assertj:assertj-core:jar:3.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:compile
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] |  |     \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.17:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test <====== HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants