如何从GIT运行Spring-boot-sample项目?

时间:2015-07-31 08:30:56

标签: java maven spring-boot

Collegues,通过链接

有spring-boot示例项目
  

https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-ws

我将它和其他相关项目导入eclipse。 我运行命令后:

  

的git \弹簧引导\弹簧引导样本\弹簧引导样品-WS> MVN   弹簧引导:运行

我收到下一个堆栈跟踪:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot Web Services Sample 1.3.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT:run (default-cli) > test-compile @ spring-boot-sample-ws >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-boot-sample-ws ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot-sample-ws ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring-boot-sample-ws ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\MAYA\git\spring-boot\spring-boot-samples\spring-boot-sample-ws\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-boot-sample-ws ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\MAYA\git\spring-boot\spring-boot-samples\spring-boot-sample-ws\target\test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT:run (default-cli) < test-compile @ spring-boot-sample-ws <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT:run (default-cli) @ spring-boot-sample-ws ---
[WARNING]
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:497)
        at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.springframework.core.ResolvableType.forInstance(Ljava/lang/Object;)Lorg/springframework/core/Resolvab
leType;
        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:105)
        at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:54)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:278)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:958)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:947)
        at sample.ws.SampleWsApplication.main(SampleWsApplication.java:26)
        ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.438 s
[INFO] Finished at: 2015-07-31T11:21:20+03:00
[INFO] Final Memory: 27M/281M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT:run (default-cli) on project spring-boot-sa
mple-ws: An exception occured while running. null: InvocationTargetException: org.springframework.core.ResolvableType.forInstance(Ljava/lang/Obje
ct;)Lorg/springframework/core/ResolvableType; -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

如何修复此异常并运行项目?

更新1 看起来很奇怪Spring Boot陷入了失败。

  

git \ spring-boot&gt; mvn clean package

[INFO] Spring Boot Dependencies ........................... SUCCESS [  6.249 s]
[INFO] Spring Boot Parent ................................. SUCCESS [  1.564 s]
[INFO] Spring Boot Tools .................................. SUCCESS [  0.367 s]
[INFO] Spring Boot Configuration Metadata ................. SUCCESS [  3.910 s]
[INFO] Spring Boot Configuration Processor ................ SUCCESS [ 14.730 s]
[INFO] Spring Boot Loader ................................. SUCCESS [ 12.632 s]
[INFO] Spring Boot Loader Tools ........................... SUCCESS [ 16.490 s]
[INFO] Spring Boot Maven Plugin ........................... SUCCESS [  9.977 s]
[INFO] Spring Boot Gradle Plugin .......................... SUCCESS [01:11 min]
[INFO] Spring Boot Antlib ................................. SUCCESS [ 17.468 s]
[INFO] Spring Boot ........................................ FAILURE [ 43.134 s]
[INFO] Spring Boot AutoConfigure .......................... SKIPPED
[INFO] Spring Boot Actuator ............................... SKIPPED
[INFO] Spring Boot Starters ............................... SKIPPED
[INFO] Spring Boot Logger Starter ......................... SKIPPED
[INFO] Spring Boot Starter ................................ SKIPPED
[INFO] Spring Boot Tomcat Starter ......................... SKIPPED
[INFO] Spring Boot Validation Starter ..................... SKIPPED
[INFO] Spring Boot Web Starter ............................ SKIPPED
[INFO] Spring Boot Thymeleaf Starter ...................... SKIPPED
[INFO] Spring Boot Developer Tools ........................ SKIPPED
[INFO] Spring Boot Docs ................................... SKIPPED
[INFO] Spring Boot AMPQ Starter ........................... SKIPPED
[INFO] Spring Boot AOP Starter ............................ SKIPPED
[INFO] Spring Boot Artemis Starter ........................ SKIPPED
[INFO] Spring Boot Batch Starter .......................... SKIPPED
[INFO] Spring Boot Cache Starter .......................... SKIPPED
[INFO] Spring Boot Spring Cloud Connectors Starter ........ SKIPPED
[INFO] Spring Boot Data Elasticsearch Starter ............. SKIPPED
[INFO] Spring Boot Data GemFire Starter ................... SKIPPED
[INFO] Spring Boot JDBC Starter ........................... SKIPPED
[INFO] Spring Boot Data JPA Starter ....................... SKIPPED
[INFO] Spring Boot Data MongoDB Starter ................... SKIPPED
[INFO] Spring Boot Data REST Starter ...................... SKIPPED
[INFO] Spring Boot Data Solr Starter ...................... SKIPPED
[INFO] Spring Boot FreeMarker Starter ..................... SKIPPED
[INFO] Spring Boot Groovy Templates Starter ............... SKIPPED
[INFO] Spring Boot HATEOAS Starter ........................ SKIPPED
[INFO] Spring Boot HornetQ Starter ........................ SKIPPED
[INFO] Spring Boot Integration Starter .................... SKIPPED
[INFO] Spring Boot Jersey Starter ......................... SKIPPED
[INFO] Spring Boot Jetty Starter .......................... SKIPPED
[INFO] Spring Boot JOOQ Starter ........................... SKIPPED
[INFO] Spring Boot Atomikos JTA Starter ................... SKIPPED
[INFO] Spring Boot Bitronix JTA Starter ................... SKIPPED
[INFO] Spring Boot Log4J Starter .......................... SKIPPED
[INFO] Spring Boot Log4J2 Starter ......................... SKIPPED
[INFO] Spring Boot Mail Starter ........................... SKIPPED
[INFO] Spring Boot Mobile Starter ......................... SKIPPED
[INFO] spring-boot-starter-mustache ....................... SKIPPED
[INFO] Spring Boot Actuator Starter ....................... SKIPPED
[INFO] Spring Boot Starter Parent ......................... SKIPPED
[INFO] Spring Boot Redis Starter .......................... SKIPPED
[INFO] Spring Boot Security Starter ....................... SKIPPED
[INFO] Spring Boot Social Facebook Starter ................ SKIPPED
[INFO] Spring Boot Social Twitter Starter ................. SKIPPED
[INFO] Spring Boot Social LinkedIn Starter ................ SKIPPED
[INFO] Spring Boot Remote Shell Starter ................... SKIPPED
[INFO] Spring Boot Test Starter ........................... SKIPPED
[INFO] Spring Boot Undertow Starter ....................... SKIPPED
[INFO] Spring Boot Velocity Starter ....................... SKIPPED
[INFO] Spring Boot WebSocket Starter ...................... SKIPPED
[INFO] Spring Boot Web Services Starter ................... SKIPPED
[INFO] Spring Boot Actuator Docs .......................... SKIPPED
[INFO] Spring Boot CLI .................................... SKIPPED
[INFO] Spring Boot Integration Tests ...................... SKIPPED
[INFO] Spring Boot Gradle Integration Tests ............... SKIPPED
[INFO] Spring Boot Security Tests ......................... SKIPPED
[INFO] Spring Boot Security Tests - Web Hello World ....... SKIPPED
[INFO] Spring Boot Build .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

更新2

  

mvn依赖:树

[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot Web Services Sample 1.3.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ spring-boot-sample-ws ---
[INFO] org.springframework.boot:spring-boot-sample-ws:jar:1.3.0.BUILD-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.3.0.BUILD-SNAPSHOT:test
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  +- org.mockito:mockito-core:jar:1.10.19:test
[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.springframework:spring-core:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  \- org.springframework:spring-test:jar:4.2.0.BUILD-SNAPSHOT:test
[INFO] +- org.springframework.boot:spring-boot-starter-ws:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.0.BUILD-SNAPSHOT: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:slf4j-api:jar:1.7.12: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.yaml:snakeyaml:jar:1.15:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-validation:jar:1.3.0.BUILD-SNAPSHOT:compile
[INFO] |  |  |  \- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] |  |  |     +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  |     +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] |  |  |     \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.4:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.4:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.5.4:compile
[INFO] |  |  +- org.springframework:spring-web:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  \- org.springframework:spring-webmvc:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |     \- org.springframework:spring-expression:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework:spring-jms:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  +- org.springframework:spring-beans:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-context:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-messaging:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework:spring-oxm:jar:4.2.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework.ws:spring-ws-core:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.springframework.ws:spring-xml:jar:2.2.1.RELEASE:compile
[INFO] |  \- org.springframework.ws:spring-ws-support:jar:2.2.1.RELEASE:compile
[INFO] +- jaxen:jaxen:jar:1.1.6:compile
[INFO] +- org.jdom:jdom2:jar:2.0.6:compile
[INFO] \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

0 个答案:

没有答案