我从Spring Cloud Angel.SR3更新到Brixton.M1版本的spring cloud,突然我得到一个找不到错误的方法如下:
LARMITCH-M-700M:customerservice larrymitchell$ java -jar target/customerservice.jar
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.springframework.core.ResolvableType.forInstance(Ljava/lang/Object;)Lorg/springframework/core/ResolvableType;
at org.springframework.context.event.SimpleApplicationEventMulticaster.resolveDefaultEventType(SimpleApplicationEventMulticaster.java:142)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:60)
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:47)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:271)
at com.libertas.vipaas.CustomerServiceApplication.main(CustomerServiceApplication.java:40)
... 6 more
LARMITCH-M-700M:customerservice larrymitchell$
以下是我们使用的特定Main类:
@EnableCircuitBreaker
@EnableDiscoveryClient
@Configuration
@ComponentScan
@EnableAutoConfiguration(
exclude = {
MongoRepositoriesAutoConfiguration.class
}
)
@Slf4j
public class CustomerServiceApplication implements CommandLineRunner {
/**
* The main entry point
*
* @param args the command args
*/
public static void main(String[] args) {
// create our application
ApplicationContext ctx = new SpringApplication(CustomerServiceApplication.class).run(args);
}
/**
* the initialization section, put any initialization code such as database init here
* <p/>
*
* @param args the passed in parameter set from the command line
* @throws Exception if we failed
*/
@Override
public void run(String... args) throws Exception {
log.info("Put command runner code here. This is run after the entire spring application is ready to run");
}
}
根据更新的春季博客条目,我将其作为父母:
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.M1</version>
</parent>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
可能导致此问题的任何想法?
另外:这是mvn依赖tee:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building customerservice 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ customerservice ---
[INFO] com.libertas.vipaas:customerservice:jar:1.0-SNAPSHOT
[INFO] +- com.libertas.vipaas:vipaasfoundations:jar:1.0.0:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:1.6.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-context-support:jar:4.2.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.2.1.RELEASE:compile
[INFO] | +- redis.clients:jedis:jar:2.7.3:compile
[INFO] | +- com.bfjournal:embedded-redis:jar:0.11.0:compile
[INFO] | +- org.springframework.security:spring-security-jwt:jar:1.0.3.RELEASE:compile
[INFO] | | \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile
[INFO] | | \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile
[INFO] | +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | \- org.apache.httpcomponents:httpclient:jar:4.5:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.4.1:compile
[INFO] +- com.libertas.vipaas:vipaaspersistency:jar:1.0.0:compile
[INFO] +- com.libertas.vipaas:vipaassecurity:jar:1.0.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.0.M5:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | | \- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.7.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.16:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.3.0.M5:compile
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.3.0.M5:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.3.0.M5:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.26:compile
[INFO] | | \- org.hibernate:hibernate-validator:jar:5.2.1.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | \- org.jboss.logging:jboss-logging:jar:3.2.1.Final:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.1:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.6.1:compile
[INFO] | +- org.springframework:spring-web:jar:4.2.1.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.2.1.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jetty:jar:1.3.0.M5:compile
[INFO] | +- org.eclipse.jetty:jetty-servlets:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-continuation:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-http:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-util:jar:9.2.13.v20150730:compile
[INFO] | | \- org.eclipse.jetty:jetty-io:jar:9.2.13.v20150730:compile
[INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-xml:jar:9.2.13.v20150730:compile
[INFO] | | \- org.eclipse.jetty:jetty-servlet:jar:9.2.13.v20150730:compile
[INFO] | | \- org.eclipse.jetty:jetty-security:jar:9.2.13.v20150730:compile
[INFO] | | \- org.eclipse.jetty:jetty-server:jar:9.2.13.v20150730:compile
[INFO] | +- org.eclipse.jetty.websocket:websocket-server:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-common:jar:9.2.13.v20150730:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-client:jar:9.2.13.v20150730:compile
[INFO] | | \- org.eclipse.jetty.websocket:websocket-servlet:jar:9.2.13.v20150730:compile
[INFO] | \- org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.2.13.v20150730:compile
[INFO] | +- org.eclipse.jetty:jetty-annotations:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-plus:jar:9.2.13.v20150730:compile
[INFO] | | | \- org.eclipse.jetty:jetty-jndi:jar:9.2.13.v20150730:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | +- org.ow2.asm:asm:jar:5.0.1:compile
[INFO] | | \- org.ow2.asm:asm-commons:jar:5.0.1:compile
[INFO] | | \- org.ow2.asm:asm-tree:jar:5.0.1:compile
[INFO] | +- org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.2.13.v20150730:compile
[INFO] | \- javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-aop:jar:1.3.0.M5:compile
[INFO] | +- org.springframework:spring-aop:jar:4.2.1.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.aspectj:aspectjrt:jar:1.8.6:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.6:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-mongodb:jar:1.3.0.M5:compile
[INFO] | +- org.mongodb:mongo-java-driver:jar:2.13.2:compile
[INFO] | \- org.springframework.data:spring-data-mongodb:jar:1.8.0.RELEASE:compile
[INFO] | \- org.springframework.data:spring-data-commons:jar:1.11.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:4.0.2.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:4.0.2.RELEASE:compile
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.2.1.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.2.1.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:4.0.2.RELEASE:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.M1:compile
[INFO] | +- org.springframework.cloud:spring-cloud-context:jar:1.1.0.M1:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:4.0.2.RELEASE:compile
[INFO] | \- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.M1:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.0.M1:compile
[INFO] | +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.0.M1:compile
[INFO] | | +- com.netflix.ribbon:ribbon:jar:2.1.0:compile
[INFO] | | | +- com.netflix.ribbon:ribbon-transport:jar:2.1.0:runtime
[INFO] | | | | +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] | | | | \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] | | | \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] | | +- com.netflix.ribbon:ribbon-core:jar:2.1.0:compile
[INFO] | | +- com.netflix.ribbon:ribbon-httpclient:jar:2.1.0:compile
[INFO] | | | \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
[INFO] | | +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.1.0:compile
[INFO] | | | \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] | | \- io.reactivex:rxjava:jar:1.0.14:compile
[INFO] | \- com.netflix.ribbon:ribbon-eureka:jar:2.1.0:compile
[INFO] | \- com.netflix.eureka:eureka2-client-shaded:jar:2.0.0-rc.2:runtime
[INFO] | +- io.netty:netty-codec-http:jar:4.0.25.Final:runtime
[INFO] | | +- io.netty:netty-codec:jar:4.0.25.Final:runtime
[INFO] | | \- io.netty:netty-handler:jar:4.0.25.Final:runtime
[INFO] | \- io.netty:netty-transport-native-epoll:jar:4.0.25.Final:runtime
[INFO] | +- io.netty:netty-common:jar:4.0.25.Final:runtime
[INFO] | +- io.netty:netty-buffer:jar:4.0.25.Final:runtime
[INFO] | \- io.netty:netty-transport:jar:4.0.25.Final:runtime
[INFO] +- org.springframework.cloud:spring-cloud-config-client:jar:1.1.0.M1:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.1:compile
[INFO] +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.M1:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-hystrix:jar:1.1.0.M1:compile
[INFO] | +- com.netflix.hystrix:hystrix-core:jar:1.4.13:compile
[INFO] | +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.4.13:compile
[INFO] | \- com.netflix.hystrix:hystrix-javanica:jar:1.4.13:compile
[INFO] | \- com.google.code.findbugs:jsr305:jar:2.0.0:runtime
[INFO] +- org.springframework.cloud:spring-cloud-starter-bus-amqp:jar:1.1.0.M1:compile
[INFO] | +- org.springframework.cloud:spring-cloud-bus:jar:1.1.0.M1:compile
[INFO] | +- org.springframework.integration:spring-integration-java-dsl:jar:1.0.0.RELEASE:compile
[INFO] | | \- org.springframework.integration:spring-integration-core:jar:4.2.0.RELEASE:compile
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.1.2.RELEASE:compile
[INFO] | +- org.springframework.integration:spring-integration-amqp:jar:4.2.0.RELEASE:compile
[INFO] | | \- org.springframework.amqp:spring-rabbit:jar:1.5.0.RC1:compile
[INFO] | | +- org.springframework.amqp:spring-amqp:jar:1.5.0.RC1:compile
[INFO] | | +- com.rabbitmq:amqp-client:jar:3.5.4:compile
[INFO] | | \- com.rabbitmq:http-client:jar:1.0.0.RELEASE:compile
[INFO] | \- org.springframework.integration:spring-integration-event:jar:4.2.0.RELEASE:compile
[INFO] +- org.springframework.cloud:spring-cloud-netflix-hystrix-amqp:jar:1.1.0.M1:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-amqp:jar:1.3.0.M5:compile
[INFO] | \- org.springframework:spring-messaging:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework.session:spring-session:jar:1.0.2.RELEASE:compile
[INFO] +- org.springframework.session:spring-session-data-redis:pom:1.0.2.RELEASE:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-redis:jar:1.3.0.M5:compile
[INFO] +- org.jolokia:jolokia-core:jar:1.3.1:compile
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- org.springframework:spring-oxm:jar:4.2.1.RELEASE:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] +- com.google.maps:google-maps-services:jar:0.1.7:compile
[INFO] | +- com.google.code.gson:gson:jar:2.3.1:compile
[INFO] | +- com.squareup.okhttp:okhttp:jar:2.0.0:compile
[INFO] | | \- com.squareup.okio:okio:jar:1.0.0:compile
[INFO] | \- joda-time:joda-time:jar:2.8.2:compile
[INFO] +- com.mangofactory:swagger-springmvc:jar:0.8.8:compile
[INFO] | +- com.wordnik:swagger-core_2.10:jar:1.3.5:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.1.5:compile
[INFO] | | | +- org.scala-lang:scala-library:jar:2.10.0:compile
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | | \- org.scala-lang:scala-reflect:jar:2.10.0:compile
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.1.0:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.0.0:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.0.0:compile
[INFO] | | +- com.wordnik:swagger-annotations:jar:1.3.5:compile
[INFO] | | +- org.json4s:json4s-ext_2.10:jar:3.2.5:compile
[INFO] | | | \- org.joda:joda-convert:jar:1.2:compile
[INFO] | | +- org.json4s:json4s-native_2.10:jar:3.2.5:compile
[INFO] | | | \- org.json4s:json4s-core_2.10:jar:3.2.5:compile
[INFO] | | | +- org.json4s:json4s-ast_2.10:jar:3.2.5:compile
[INFO] | | | \- org.scala-lang:scalap:jar:2.10.0:compile
[INFO] | | | \- org.scala-lang:scala-compiler:jar:2.10.0:compile
[INFO] | | \- org.json4s:json4s-jackson_2.10:jar:3.2.5:compile
[INFO] | +- cglib:cglib:jar:2.2:compile
[INFO] | | \- asm:asm:jar:3.1:compile
[INFO] | +- com.google.guava:guava:jar:18.0:compile
[INFO] | +- com.mangofactory.swagger:swagger-models:jar:0.8.8:compile
[INFO] | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.2.1-b03:provided
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- com.jayway.jsonpath:json-path:jar:2.0.0:runtime
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | \- net.minidev:json-smart:jar:2.1.1:runtime
[INFO] | \- net.minidev:asm:jar:1.0.2:runtime
[INFO] +- org.projectlombok:lombok:jar:1.16.6:compile
[INFO] +- com.netflix.eureka:eureka-client:jar:1.2.0: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.1.2:runtime
[INFO] | | +- org.apache.commons:commons-math:jar:2.2:runtime
[INFO] | | \- com.netflix.netflix-commons:netflix-infix:jar:0.1.2: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] | +- com.netflix.archaius:archaius-core:jar:0.6.5:runtime
[INFO] | | +- commons-configuration:commons-configuration:jar:1.8:runtime
[INFO] | | \- com.google.code.findbugs:annotations:jar:2.0.0:runtime
[INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] | +- com.netflix.servo:servo-core:jar:0.9.4:runtime
[INFO] | | \- com.netflix.servo:servo-internal:jar:0.9.4:runtime
[INFO] | +- com.sun.jersey:jersey-core:jar:1.13:runtime
[INFO] | +- com.sun.jersey:jersey-client:jar:1.13:runtime
[INFO] | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.11:runtime
[INFO] | +- com.google.inject:guice:jar:4.0:runtime
[INFO] | | \- javax.inject:javax.inject:jar:1:runtime
[INFO] | \- com.netflix.governator:governator-annotations:jar:1.7.5:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.3.0.M5:test
[INFO] | +- junit:junit:jar:4.12:compile
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | \- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- com.github.fakemongo:fongo:jar:1.5.7:compile
[INFO] | +- com.github.davidmoten:geo:jar:0.6.6:compile
[INFO] | +- rhino:js:jar:1.7R2:compile
[INFO] | \- com.vividsolutions:jts:jar:1.13:compile
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.powermock:powermock-easymock-release-full:jar:full:1.5.5:test
[INFO] | +- org.powermock:powermock-core:jar:1.5.5:test
[INFO] | | \- org.javassist:javassist:jar:3.18.1-GA:test
[INFO] | +- org.powermock:powermock-api-easymock:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4-common:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4-legacy:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit3:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-reflect:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-api-support:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-module-testng:jar:1.5.5:test
[INFO] | | \- org.testng:testng:jar:6.8.8:test
[INFO] | | +- org.beanshell:bsh:jar:2.0b4:test
[INFO] | | \- com.beust:jcommander:jar:1.27:test
[INFO] | +- org.powermock:powermock-module-testng-common:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-classloading-base:jar:1.5.5:test
[INFO] | +- org.powermock:powermock-core:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-api-easymock:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4-common:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit4-legacy:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-module-junit3:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-module-testng:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-reflect:jar:sources:1.5.5:test
[INFO] | +- org.powermock:powermock-api-support:jar:sources:1.5.5:test
[INFO] | \- org.powermock:powermock-classloading-base:jar:sources:1.5.5:test
[INFO] +- org.easymock:easymock:jar:3.2:test
[INFO] | \- cglib:cglib-nodep:jar:3.1:test
[INFO] \- org.springframework:spring-test:jar:4.2.1.RELEASE:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
答案 0 :(得分:4)
您在类路径中混合使用了Spring 4.2.1.RELEASE和4.1.7.RELEASE。你需要前者而不是后者。具体来说,类路径上的spring-core
版本错误:
[INFO] | +- org.springframework:spring-core:jar:4.1.7.RELEASE:compile
我猜你在spring-core
上依赖于声明的显式版本。如果删除<version>
,spring-cloud-starter-parent
提供的依赖关系管理将为您提供正确的版本(4.2.1.RELEASE)。