Maven 瞬时依赖项(library/jar vaadin json)未被排除

2024-03-31

我有一个问题,maven 包含 2 个版本org.json来自两个不同依赖项的包。

我有以下内容:

<dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

但我也有以下输出(瓦丁是我不想要的人 ):

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.3.RELEASE:test

依赖树显示以下两个条目:

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.3.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.0.3.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.3.RELEASE:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] |  +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.7.11:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] |  |  \- org.objenesis:objenesis:jar:2.6:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:runtime

AND

[INFO] +- org.json:json:jar:20171018:compile

我已经尝试了以下方法,但烦人的 vaadin jar 仍然包含在项目中:

<dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mbak.test</groupId>
            <artifactId>mb-cloud-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

这导致方法未找到异常。 如果我们手动从打包的 war 中删除 JAR,一切都很好!

Update

下面是完整的堆栈跟踪:

[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ mb-doc-tools ---
[INFO] Verbose not supported since maven-dependency-plugin 3.0
[INFO] org.mbak.menios:mb-doc-tools:war:0.0.1-SNAPSHOT
[INFO] +- org.mbak.mb.meniosapp:mb-cloud-starter:jar:2.0.6.19-SNAPSHOT:compile
[INFO] |  +- org.mbak.mb.meniosapp:mb-masc:jar:0.0.0-SNAPSHOT:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] |  |  +- de.escalon.hypermedia:hydra-spring:jar:0.3.1:compile
[INFO] |  |  |  +- de.escalon.hypermedia:hydra-jsonld:jar:0.3.1:compile
[INFO] |  |  |  |  \- de.escalon.hypermedia:hydra-commons:jar:0.3.1:compile
[INFO] |  |  |  +- de.escalon.hypermedia:spring-hateoas-ext:jar:0.3.1:compile
[INFO] |  |  |  |  \- com.damnhandy:handy-uri-templates:jar:2.1.4:compile
[INFO] |  |  |  \- com.github.jsonld-java:jsonld-java:jar:0.5.1:compile
[INFO] |  |  |     +- org.apache.httpcomponents:httpclient-cache:jar:4.5.6:compile
[INFO] |  |  |     \- org.slf4j:jcl-over-slf4j:jar:1.7.25:runtime
[INFO] |  |  \- org.springframework.hateoas:spring-hateoas:jar:0.25.0.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-commons:jar:2.0.8.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.0.7.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-properties-migrator:jar:2.0.5.RELEASE:runtime
[INFO] |  |  \- org.springframework.boot:spring-boot-configuration-metadata:jar:2.0.5.RELEASE:runtime
[INFO] |  +- org.jolokia:jolokia-core:jar:1.5.0:compile
[INFO] |  |  \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-config:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-starter:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.cloud:spring-cloud-context:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.5.RELEASE:compile
[INFO] |  |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile
[INFO] |  |  |        \- org.bouncycastle:bcprov-jdk15on:jar:1.56:compile
[INFO] |  |  \- org.springframework.cloud:spring-cloud-config-client:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-commons:jar:2.0.0.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-crypto:jar:5.0.6.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- com.netflix.eureka:eureka-client:jar:1.9.2:compile
[INFO] |  |  |  +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] |  |  |  |  \- stax:stax-api:jar:1.0.1:runtime
[INFO] |  |  |  +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] |  |  |  |  +- com.netflix.netflix-commons:netflix-appix:jar:0.3.0:runtime
[INFO] |  |  |  |  |  +- commons-jxpath:commons-jxpath:jar:1.3:runtime
[INFO] |  |  |  |  |  \- org.antlr:antlr-runtime:jar:3.4:runtime
[INFO] |  |  |  |  |     +- org.antlr:stringtemplate:jar:3.2.1:runtime
[INFO] |  |  |  |  |     \- antlr:antlr:jar:2.7.7:runtime
[INFO] |  |  |  |  \- org.apache.commons:commons-math:jar:2.2:runtime
[INFO] |  |  |  +- com.netflix.archaius:archaius-core:jar:0.7.6:compile
[INFO] |  |  |  +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] |  |  |  +- com.netflix.servo:servo-core:jar:0.12.21:runtime
[INFO] |  |  |  +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO] |  |  |  +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO] |  |  |  +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] |  |  |  +- com.google.inject:guice:jar:4.1.0:runtime
[INFO] |  |  |  |  \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] |  |  |  \- com.github.vlsi.compactmap:compactmap:jar:1.2.1:runtime
[INFO] |  |  |     \- com.github.andrewoma.dexx:dexx-collections:jar:0.2:runtime
[INFO] |  |  +- com.netflix.eureka:eureka-core:jar:1.9.2:compile
[INFO] |  |  |  \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] |  |  |     +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] |  |  |     \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] |  |  +- org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.cloud:spring-cloud-netflix-archaius:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] |  |  \- com.netflix.ribbon:ribbon-eureka:jar:2.2.5:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-zuul:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-zuul:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-commons-util:jar:0.3.0:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-starter-netflix-hystrix:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- com.netflix.hystrix:hystrix-core:jar:1.5.12:compile
[INFO] |  |  |  +- com.netflix.hystrix:hystrix-serialization:jar:1.5.12:compile
[INFO] |  |  |  |  \- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.9.6:runtime
[INFO] |  |  |  +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.12:compile
[INFO] |  |  |  +- com.netflix.hystrix:hystrix-javanica:jar:1.5.12:compile
[INFO] |  |  |  |  \- org.ow2.asm:asm:jar:5.0.4:runtime
[INFO] |  |  |  \- io.reactivex:rxjava-reactive-streams:jar:1.2.1:compile
[INFO] |  |  |     \- org.reactivestreams:reactive-streams:jar:1.0.2:runtime
[INFO] |  |  \- com.netflix.zuul:zuul-core:jar:1.3.1:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-ribbon:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon:jar:2.2.5:compile
[INFO] |  |  |  +- com.netflix.ribbon:ribbon-transport:jar:2.2.5:runtime
[INFO] |  |  |  |  +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] |  |  |  |  \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] |  |  |  +- javax.inject:javax.inject:jar:1:runtime
[INFO] |  |  |  \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] |  |  |     +- io.netty:netty-codec-http:jar:4.1.25.Final:runtime
[INFO] |  |  |     |  \- io.netty:netty-codec:jar:4.1.25.Final:runtime
[INFO] |  |  |     \- io.netty:netty-transport-native-epoll:jar:4.1.25.Final:runtime
[INFO] |  |  |        +- io.netty:netty-common:jar:4.1.25.Final:runtime
[INFO] |  |  |        +- io.netty:netty-buffer:jar:4.1.25.Final:runtime
[INFO] |  |  |        +- io.netty:netty-transport-native-unix-common:jar:4.1.25.Final:runtime
[INFO] |  |  |        \- io.netty:netty-transport:jar:4.1.25.Final:runtime
[INFO] |  |  |           \- io.netty:netty-resolver:jar:4.1.25.Final:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-core:jar:2.2.5:compile
[INFO] |  |  |  \- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.5:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.5:compile
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] |  |  \- io.reactivex:rxjava:jar:1.3.8:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-openfeign:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-openfeign-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- io.github.openfeign:feign-core:jar:9.5.1:compile
[INFO] |  |  +- io.github.openfeign:feign-slf4j:jar:9.5.1:compile
[INFO] |  |  +- io.github.openfeign:feign-hystrix:jar:9.5.1:compile
[INFO] |  |  \- io.github.openfeign:feign-java8:jar:9.5.1:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.4.5.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-hystrix:jar:1.4.5.RELEASE:compile
[INFO] |  +- io.github.openfeign.form:feign-form:jar:3.3.0:compile
[INFO] |  |  \- com.google.code.findbugs:annotations:jar:3.0.1:compile
[INFO] |  |     \- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |  +- io.github.openfeign.form:feign-form-spring:jar:3.3.0:compile
[INFO] |  |  \- commons-fileupload:commons-fileupload:jar:1.3.3:compile
[INFO] |  +- com.keyholesoftware:khs-spring-boot-troublemaker-starter:jar:1.0.0:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] |  +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  +- net.logstash.logback:logstash-logback-encoder:jar:4.11:compile
[INFO] |  +- ch.qos.logback:logback-access:jar:1.2.3:compile
[INFO] |  +- commons-io:commons-io:jar:2.6:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-sleuth:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.0.5.RELEASE:compile
[INFO] |  |  |  \- org.aspectj:aspectjweaver:jar:1.8.13:compile
[INFO] |  |  \- org.springframework.cloud:spring-cloud-sleuth-core:jar:2.0.0.RELEASE:compile
[INFO] |  |     +- org.aspectj:aspectjrt:jar:1.8.13:compile
[INFO] |  |     +- io.zipkin.brave:brave:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-context-log4j2:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-spring-web:jar:5.1.0:compile
[INFO] |  |     |  \- io.zipkin.brave:brave-instrumentation-http:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-spring-rabbit:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-kafka-clients:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-httpclient:jar:5.1.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-httpasyncclient:jar:5.1.0:compile
[INFO] |  |     \- io.zipkin.brave:brave-instrumentation-spring-webmvc:jar:5.1.0:compile
[INFO] |  |        \- io.zipkin.brave:brave-instrumentation-servlet:jar:5.1.0:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-zipkin:jar:2.0.0.RELEASE:compile
[INFO] |  |  \- org.springframework.cloud:spring-cloud-sleuth-zipkin:jar:2.0.0.RELEASE:compile
[INFO] |  |     +- io.zipkin.zipkin2:zipkin:jar:2.9.3:compile
[INFO] |  |     +- io.zipkin.reporter2:zipkin-reporter:jar:2.7.3:compile
[INFO] |  |     +- io.zipkin.reporter2:zipkin-sender-kafka11:jar:2.7.3:compile
[INFO] |  |     \- io.zipkin.reporter2:zipkin-sender-amqp-client:jar:2.7.3:compile
[INFO] |  +- io.micrometer:micrometer-core:jar:1.0.6:compile
[INFO] |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
[INFO] |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] |  +- io.micrometer:micrometer-registry-prometheus:jar:1.0.6:compile
[INFO] |  |  \- io.prometheus:simpleclient_common:jar:0.4.0:compile
[INFO] |  |     \- io.prometheus:simpleclient:jar:0.4.0:compile
[INFO] |  +- org.togglz:togglz-spring-boot-starter:jar:2.7.0-SNAPSHOT:compile
[INFO] |  |  \- org.togglz:togglz-spring-boot-autoconfigure:jar:2.7.0-SNAPSHOT:compile
[INFO] |  |     +- org.togglz:togglz-core:jar:2.7.0-SNAPSHOT:compile
[INFO] |  |     +- org.togglz:togglz-spring-core:jar:2.7.0-SNAPSHOT:compile
[INFO] |  |     \- org.togglz:togglz-spring-web:jar:2.7.0-SNAPSHOT:compile
[INFO] |  +- org.togglz:togglz-console:jar:2.7.0-SNAPSHOT:compile
[INFO] |  |  \- org.togglz:togglz-servlet:jar:2.7.0-SNAPSHOT:compile
[INFO] |  \- io.github.anand1st:sshd-shell-spring-boot-starter:jar:2.5:compile
[INFO] |     +- org.apache.sshd:sshd-core:jar:1.6.0:compile
[INFO] |     +- org.jline:jline-reader:jar:3.5.1:compile
[INFO] |     |  \- org.jline:jline-terminal:jar:3.5.1:compile
[INFO] |     \- org.jline:jline-builtins:jar:3.5.1:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- org.mbak.mb.meniosapp:mb-cloud-starter-test:jar:2.0.0-SNAPSHOT:test
[INFO] +- com.aspose:aspose-cells:jar:8.8.2:compile
[INFO] +- com.aspose.pdf:aspose-pdf-jdk16:jar:9.3.1.0:compile
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.10:compile
[INFO] |  +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |  \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- com.stanfy:gson-xml-java:jar:0.1.7:compile
[INFO] +- org.json:json:jar:20171018:compile
[INFO] +- com.aspose:aspose-words:jar:jdk16:16.8.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.5.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.5.RELEASE:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.34:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.34:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.34:compile
[INFO] |  +- org.hibernate.validator:hibernate-validator:jar:6.0.12.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  +- org.springframework:spring-web:jar:5.0.7.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.0.7.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.0.7.RELEASE:compile
[INFO] |     +- org.springframework:spring-context:jar:5.0.7.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.5.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] |     \- org.springframework.boot:spring-boot-actuator:jar:2.0.5.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.0.5.RELEASE:runtime
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.0.5.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.5.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.0.5.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.5.RELEASE:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] |  +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.7.11:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] |  |  \- org.objenesis:objenesis:jar:2.6:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test

-here

[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:runtime
[INFO] |  +- org.springframework:spring-core:jar:5.0.9.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.0.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-test:jar:5.0.7.RELEASE:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.5.1:test
[INFO] +- org.springframework.restdocs:spring-restdocs-mockmvc:jar:2.0.0.RELEASE:test
[INFO] |  \- javax.servlet:javax.servlet-api:jar:3.1.0:test
[INFO] +- io.rest-assured:rest-assured:jar:3.0.6:test
[INFO] |  +- org.codehaus.groovy:groovy:jar:2.4.15:compile
[INFO] |  +- org.codehaus.groovy:groovy-xml:jar:2.4.15:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.5.6:test
[INFO] |  \- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile
[INFO] +- io.rest-assured:xml-path:jar:3.0.6:compile
[INFO] |  +- io.rest-assured:rest-assured-common:jar:3.0.6:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] |  \- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] +- io.rest-assured:json-path:jar:3.0.6:compile
[INFO] |  \- org.codehaus.groovy:groovy-json:jar:2.4.15:compile
[INFO] +- io.rest-assured:json-schema-validator:jar:3.0.6:test
[INFO] |  \- com.github.fge:json-schema-validator:jar:2.2.6:test
[INFO] |     +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] |     +- joda-time:joda-time:jar:2.9.9:compile
[INFO] |     +- com.googlecode.libphonenumber:libphonenumber:jar:6.2:test
[INFO] |     +- com.github.fge:json-schema-core:jar:1.2.5:test
[INFO] |     |  +- com.github.fge:uri-template:jar:0.9:test
[INFO] |     |  |  \- com.github.fge:mmb-simple:jar:1.1:test
[INFO] |     |  |     \- com.github.fge:btf:jar:1.2:test
[INFO] |     |  +- com.github.fge:jackson-coreutils:jar:1.8:test
[INFO] |     |  \- org.mozilla:rhino:jar:1.7R4:test
[INFO] |     +- javax.mail:mailapi:jar:1.4.3:test
[INFO] |     |  \- javax.activation:activation:jar:1.1:test
[INFO] |     \- net.sf.jopt-simple:jopt-simple:jar:4.6:test
[INFO] +- org.springframework.restdocs:spring-restdocs-core:jar:2.0.0.RELEASE:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] +- org.springframework.restdocs:spring-restdocs-restassured:jar:2.0.0.RELEASE:compile
[INFO] +- capital.scalable:spring-auto-restdocs-core:jar:1.0.11:test
[INFO] |  +- commons-collections:commons-collections:jar:3.2.2:runtime
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.8.0:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.5.14:compile
[INFO] |  +- io.swagger:swagger-models:jar:1.5.14:compile
[INFO] |  +- io.springfox:springfox-spi:jar:2.8.0:compile
[INFO] |  |  \- io.springfox:springfox-core:jar:2.8.0:compile
[INFO] |  +- io.springfox:springfox-schema:jar:2.8.0:compile
[INFO] |  +- io.springfox:springfox-swagger-common:jar:2.8.0:compile
[INFO] |  +- io.springfox:springfox-spring-web:jar:2.8.0:compile
[INFO] |  |  \- org.reflections:reflections:jar:0.9.11:compile
[INFO] |  |     \- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] |  +- com.google.guava:guava:jar:20.0:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  \- org.mapstruct:mapstruct:jar:1.2.0.Final:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.8.0:compile
[INFO] \- org.projectlombok:lombok:jar:1.16.22:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

因为 vaadin 我得到了:

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.json.JSONObject.entrySet()Ljava/util/Set;
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1006)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

Update

我尝试了以下方法,但仍然无法排除 vaadin:

<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>

此外,我注意到当你这样做时,行为会有所不同mvn spring-boot:run当您运行打包的 war 文件时。

当运行打包的war文件时,我们遇到错误。当我们执行 spring-boot:run 时,我们不会。

奇怪的修复

我的一位同事通过输入以下排除项解决了这个问题(但我不明白为什么它有效):

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

有人有什么想法吗?

类似/相同的问题

https://github.com/spring-projects/spring-boot/issues/8706 https://github.com/spring-projects/spring-boot/issues/8706

https://github.com/spring-projects/spring-boot/issues/9248 https://github.com/spring-projects/spring-boot/issues/9248

Gradle 依赖项排除后依赖项仍然依赖于类路径 https://stackoverflow.com/questions/46939579/dependency-still-on-classpath-after-gradle-dependency-exclusion


您可以指定要与依赖项 org.json 一起使用的版本,并在您不想要的依赖项之上使用该依赖项。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Maven 瞬时依赖项(library/jar vaadin json)未被排除 的相关文章

  • 清理码头 - 删除“不必要”的东西

    我习惯用Jetty http jetty codehaus org jetty 作为我的网络容器 我对我做了什么安装步骤得到原始的焦油球并且清理一些目录和文件从中 我在这里想提出的是 您通常从 Jetty 中删除什么以在生产 登台环境中使用
  • Android 2.2 SDK - Droid X 相机活动无法正常完成

    我注意到我在 Droid X 上调用的默认相机活动与我的 Droid 和 Nexus One 上的默认相机活动看起来不同 在 Droid 和 Nexus One 上选择 确定 后 活动将完成 Droid X 有一个 完成 按钮 它将带您返回
  • 禁用 Eclipse Java 调试器的热代码替换 [重复]

    这个问题在这里已经有答案了 可能的重复 如何在 Eclipse 中禁用热代码替换 https stackoverflow com questions 2594408 how do i disable hot code replace in
  • Spring安全“记住我”cookie在第一个请求中不可用

    我无法在登录请求后检索 Spring 记住我 cookie 但它在对受保护页面的下一个请求中工作正常 谁能告诉我怎样才能立即得到它 我在登录请求中设置了记住我的 cookie 但在 Spring 重定向回原始 受保护的 url 后无法检索它
  • Java套接字:在连接被拒绝异常时重试的最佳方法?

    现在我正在这样做 while true try SocketAddress sockaddr new InetSocketAddress ivDestIP ivDestPort downloadSock new Socket downloa
  • 在java中实现你自己的阻塞队列

    我知道这个问题之前已经被问过并回答过很多次了 但我只是无法根据互联网上找到的示例找出窍门 例如this http tutorials jenkov com java concurrency blocking queues html or t
  • Java:正则表达式排除空值

    在问题中here https stackoverflow com questions 51359056 java regexp for a separated group of digits 我得到了正则表达式来匹配 1 到 99 之间的一
  • 隐式超级构造函数 Person() 未定义。必须显式调用另一个构造函数?

    我正在开发一个项目 但收到错误 隐式超级构造函数 Person 未定义 必须显式调用另一个构造函数 我不太明白它 这是我的人物课程 public class Person public Person String name double D
  • Git 无法识别重命名和修改的包文件

    我有一个名为的java文件package old myfile java 我已经通过 git 提交了这个文件 然后我将我的包重命名为new所以我的文件在package new myfile java 我现在想将此文件重命名 和内容更改 提交
  • Java 数组的最大维数

    出于好奇 在 Java 中数组可以有多少维 爪哇language不限制维数 但是JavaVM规范将维度数限制为 255 例如 以下代码将无法编译 class Main public static void main String args
  • 无法加载或查找主类,可以在命令行中使用,但不能在 IDE 中使用[重复]

    这个问题在这里已经有答案了 在将其标记为重复之前 请先听我说完 我正在尝试使用 gradle 导入一个 java 项目 功能齐全 适用于所有其他笔记本电脑 没有问题 我的项目 100 正常运行 适用于所有其他笔记本电脑 当我的笔记本电脑被重
  • 计算日期之间的天数差异

    在我的代码中 日期之间的差异是错误的 因为它应该是 38 天而不是 8 天 我该如何修复 package random04diferencadata import java text ParseException import java t
  • Cloudfoundry:如何组合两个运行时

    cloundfoundry 有没有办法结合两个运行时环境 我正在将 NodeJS 应用程序部署到 IBM Bluemix 现在 我还希望能够执行独立的 jar 文件 但应用程序失败 APP 0 bin sh 1 java not found
  • Spring Security OAuth2简单配置

    我有一个简单的项目 需要以下简单的配置 我有一个 密码 grant type 这意味着我可以提交用户名 密码 用户在登录表单中输入 并在成功时获得 access token 有了该 access token 我就可以请求 API 并获取用户
  • 如何配置 WebService 返回 ArrayList 而不是 Array?

    我有一个在 jax ws 上实现的 java Web 服务 此 Web 服务返回用户的通用列表 它运行得很好 Stateless name AdminToolSessionEJB RemoteBinding jndiBinding Admi
  • Java的-XX:+UseMembar参数是什么

    我在各种地方 论坛等 看到这个参数 并且常见的答案是它有助于高并发服务器 尽管如此 我还是找不到 sun 的官方文档来解释它的作用 另外 它是Java 6中添加的还是Java 5中存在的 顺便说一句 许多热点虚拟机参数的好地方是这一页 ht
  • Android - 9 补丁

    我正在尝试使用 9 块图片创建一个新的微调器背景 我尝试了很多方法来获得完美的图像 但都失败了 s Here is my 9 patch 当我用Draw 9 patch模拟时 内容看起来不错 但是带有箭头的部分没有显示 或者当它显示时 这部
  • 在android中跟踪FTP上传数据?

    我有一个运行 Android 的 FTP 系统 但我希望能够在上传时跟踪字节 这样我就可以在上传过程中更新进度条 安卓可以实现这个功能吗 现在 我正在使用org apache common net ftp我正在使用的代码如下 另外 我在 A
  • 启动Java项目时发生类冲突:ClassMetadataReadingVisitor将接口org.springframework.asm.ClassVisitor作为超类

    我正在使用最新的Spring框架版本 3 2 2 RELEASE 开发一个Java Web项目 但是现在项目启动时遇到了问题 详细错误是 java lang IncompleteClassChangeError 类 org springfr
  • 在哪里存储 Java 的 .properties 文件?

    The Java教程 http download oracle com javase tutorial essential environment properties htmlon using Properties 讨论如何使用 Prop

随机推荐