小编典典

升级到Spring Boot 1.4后服务无法启动

spring-boot

我刚刚将所有Spring Boot服务从升级1.3.6.RELEASE1.4.0.RELEASE。现在所有这些都在启动时崩溃:

Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/ObjectProvider
    at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_91]
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[na:1.8.0_91]
    at java.lang.Class.getDeclaredConstructors(Class.java:2020) ~[na:1.8.0_91]
    at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:566) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]

这是我的服务依赖关系树之一:

[INFO] com.onedesk:history-service:jar:0.0.1-SNAPSHOT
[INFO] +- com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile
[INFO] |  \- com.onedesk.shared:core:jar:1.0-SNAPSHOT:compile
[INFO] +- com.onedesk.shared:endpoints:jar:1.0-SNAPSHOT:compile
[INFO] |  +- (com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile - omitted for duplicate)
[INFO] |  +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] |  |  +- org.springframework:spring-aop:jar:4.2.6.RELEASE:compile
[INFO] |  |  |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  |  \- org.springframework:spring-expression:jar:4.2.6.RELEASE:compile
[INFO] |  |     \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  +- org.springframework:spring-web:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.7.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  \- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile
[INFO] |  |  |  \- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] |  |  |  |  +- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] |  |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.6.6; omitted for duplicate)
[INFO] |  |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] |  |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] |  |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] |  |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] |  |  |     \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] |  \- org.springframework.boot:spring-boot-actuator:jar:1.4.0.RELEASE:compile
[INFO] |     +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |     +- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |     +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |     \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] +- org.projectlombok:lombok:jar:1.16.10:compile
[INFO] +- org.springframework.boot:spring-boot-starter-remote-shell:jar:1.4.0.RELEASE:compile
[INFO] |  +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.crashub:crash.cli:jar:1.3.2:compile
[INFO] |  +- org.crashub:crash.connectors.ssh:jar:1.3.2:compile
[INFO] |  |  +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] |  |  +- org.apache.sshd:sshd-core:jar:0.11.0:compile
[INFO] |  |  |  \- (org.apache.mina:mina-core:jar:2.0.7:compile - omitted for duplicate)
[INFO] |  |  +- org.apache.sshd:sshd-pam:jar:0.11.0:compile
[INFO] |  |  |  +- (org.apache.sshd:sshd-core:jar:0.11.0:compile - omitted for duplicate)
[INFO] |  |  |  \- net.sf.jpam:jpam:jar:1.1:compile
[INFO] |  |  +- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
[INFO] |  |  +- org.bouncycastle:bcpkix-jdk15on:jar:1.51:compile
[INFO] |  |  |  \- (org.bouncycastle:bcprov-jdk15on:jar:1.51:compile - omitted for duplicate)
[INFO] |  |  \- org.apache.mina:mina-core:jar:2.0.7:compile
[INFO] |  |     \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |  +- org.crashub:crash.embed.spring:jar:1.3.2:compile
[INFO] |  |  +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] |  +- org.crashub:crash.plugins.cron:jar:1.3.2:compile
[INFO] |  |  +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] |  |  \- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] |  +- org.crashub:crash.plugins.mail:jar:1.3.2:compile
[INFO] |  |  \- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] |  +- org.crashub:crash.shell:jar:1.3.2:compile
[INFO] |  |  \- (org.crashub:crash.cli:jar:1.3.2:compile - omitted for duplicate)
[INFO] |  +- org.codehaus.groovy:groovy:jar:2.4.7:compile
[INFO] |  \- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] |     \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile
[INFO] |  +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile
[INFO] |  |     \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile - omitted for duplicate)
[INFO] |  +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile (version managed from 3.2.1.Final)
[INFO] |  |  \- com.fasterxml:classmate:jar:1.3.1:compile (version managed from 1.1.0)
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile (version managed from 2.8.0)
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile
[INFO] |  +- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] |  \- org.springframework:spring-webmvc:jar:4.2.6.RELEASE:compile (version managed from 4.3.2.RELEASE)
[INFO] |     +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-expression:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] |     \- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test
[INFO] |  |  \- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test
[INFO] |  |  +- (org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] |  |  \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] |  |  +- net.minidev:json-smart:jar:2.2.1:test
[INFO] |  |  |  \- net.minidev:accessors-smart:jar:1.1:test
[INFO] |  |  |     \- (org.ow2.asm:asm:jar:5.0.3:test - omitted for conflict with 5.0.4)
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.16; scope updated from test; omitted for duplicate)
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  |  \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] |  +- org.assertj:assertj-core:jar:2.5.0:test
[INFO] |  +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] |  |  +- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] |  |  \- org.objenesis:objenesis:jar:2.1:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  |  \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] |  |  \- (org.json:json:jar:20140107:test - version managed from 20090211; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; scope updated from test; omitted for duplicate)
[INFO] |  \- org.springframework:spring-test:jar:4.2.6.RELEASE:test (version managed from 4.3.2.RELEASE)
[INFO] |     \- (org.springframework:spring-core:jar:4.3.2.RELEASE:test - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile
[INFO] |  +- org.json:json:jar:20140107:compile
[INFO] |  \- org.springframework:spring-core:jar:4.3.2.RELEASE:compile
[INFO] \- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.0.RELEASE:compile
[INFO]    +- (org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO]    +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile
[INFO]    |  +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - version managed from 1.3.4.RELEASE; omitted for duplicate)
[INFO]    |  +- org.springframework.cloud:spring-cloud-context:jar:1.1.0.RELEASE:compile
[INFO]    |  |  \- org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile
[INFO]    |  +- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.RELEASE:compile
[INFO]    |  |  \- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - omitted for duplicate)
[INFO]    |  \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO]    |     +- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - version managed from 3.2.7.RELEASE; omitted for duplicate)
[INFO]    |     +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.1.6.RELEASE; omitted for duplicate)
[INFO]    |     \- (org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile - omitted for conflict with 1.51)
[INFO]    +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile
[INFO]    |  +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO]    |  \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO]    +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.0.RELEASE:compile
[INFO]    |  \- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO]    +- com.netflix.eureka:eureka-client:jar:1.4.6: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]    |  |  +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO]    |  |  +- (com.netflix.servo:servo-core:jar:0.10.1:runtime - version managed from 0.5.3; omitted for duplicate)
[INFO]    |  |  \- (com.netflix.archaius:archaius-core:jar:0.7.4:runtime - version managed from 0.7.3; omitted for duplicate)
[INFO]    |  +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO]    |  +- (com.netflix.archaius:archaius-core:jar:0.7.4:compile - version managed from 0.7.3; scope updated from runtime; omitted for duplicate)
[INFO]    |  +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO]    |  +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO]    |  |  +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO]    |  |  +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO]    |  |  \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO]    |  |     +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO]    |  |     \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO]    |  +- com.sun.jersey:jersey-core:jar:1.19.1:runtime (version managed from 1.19)
[INFO]    |  |  \- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[INFO]    |  +- com.sun.jersey:jersey-client:jar:1.19.1:runtime (version managed from 1.19)
[INFO]    |  |  \- (com.sun.jersey:jersey-core:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO]    |  +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime (version managed from 1.19)
[INFO]    |  |  +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.4; omitted for duplicate)
[INFO]    |  |  \- (com.sun.jersey:jersey-client:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO]    |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO]    |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime (version managed from 4.4.4)
[INFO]    |  |  \- commons-codec:commons-codec:jar:1.10:runtime (version managed from 1.9)
[INFO]    |  +- com.google.inject:guice:jar:4.0:runtime
[INFO]    |  |  +- javax.inject:javax.inject:jar:1:runtime
[INFO]    |  |  +- (aopalliance:aopalliance:jar:1.0:runtime - omitted for duplicate)
[INFO]    |  |  \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO]    |  +- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO]    |  |  \- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO]    |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO]    |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO]    |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO]    +- com.netflix.eureka:eureka-core:jar:1.4.6:compile
[INFO]    |  +- (com.netflix.eureka:eureka-client:jar:1.4.6:runtime - omitted for duplicate)
[INFO]    |  +- com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO]    |  |  +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.6; omitted for duplicate)
[INFO]    |  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.3; omitted for duplicate)
[INFO]    |  +- com.amazonaws:aws-java-sdk-ec2:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO]    |  |  \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO]    |  +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.3:runtime
[INFO]    |  |  \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO]    |  +- com.amazonaws:aws-java-sdk-sts:jar:1.9.3:runtime
[INFO]    |  |  \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO]    |  +- com.amazonaws:aws-java-sdk-route53:jar:1.9.3:runtime
[INFO]    |  |  \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO]    |  +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO]    |  |  +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO]    |  |  +- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO]    |  |  |  +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO]    |  |  |  +- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO]    |  |  |  +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.3; omitted for duplicate)
[INFO]    |  |  |  \- (com.google.inject:guice:jar:4.0:runtime - omitted for duplicate)
[INFO]    |  |  +- org.ow2.asm:asm:jar:5.0.4:runtime
[INFO]    |  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO]    |  +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO]    |  +- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[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-archaius:jar:1.1.0.RELEASE:compile
[INFO]    |  +- (org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO]    |  +- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO]    |  +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO]    |  |  +- com.google.code.findbugs:jsr305:jar:3.0.1:runtime
[INFO]    |  |  +- (commons-configuration:commons-configuration:jar:1.8:runtime - omitted for duplicate)
[INFO]    |  |  +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO]    |  |  +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0; omitted for duplicate)
[INFO]    |  |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO]    |  |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO]    |  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO]    |  +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO]    |  |  +- commons-lang:commons-lang:jar:2.6:compile
[INFO]    |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO]    |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO]    |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO]    |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO]    |  \- com.google.guava:guava:jar:18.0:compile

似乎那里有一个Spring版本的问题,但我不知道它来自哪里。这是我的pom.xml。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.onedesk</groupId>
<artifactId>history-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>history-service</name>
<description>history service</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.onedesk.shared</groupId>
        <artifactId>dto</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>com.onedesk.shared</groupId>
        <artifactId>endpoints</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-remote-shell</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-parent</artifactId>
            <version>Brixton.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
</project>

阅读 353

收藏
2020-05-30

共1个答案

小编典典

所以问题出在dependencyManagement

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-parent</artifactId>
            <version>Brixton.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

我只需要替换为:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId> <!--changed-->
            <version>Brixton.SR4</version> <!--changed-->
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
2020-05-30