通过cmd运行 - java.lang.IllegalArgumentException:源不能为空

时间:2016-11-21 15:08:13

标签: java spring maven spring-boot

我正在通过命令mvn spring-boot:run尝试run基本spring-boot application。我收到java.lang.IllegalArgumentException: Sources must not be empty错误:

$ mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot 2.0.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:run (default-cli) > test-compile @ spring-boot >>>
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-validation) @ spring-boot ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-rules) @ spring-boot ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ spring-boot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ spring-boot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 74 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-boot ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:run (default-cli) < test-compile @ spring-boot <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:run (default-cli) @ spring-boot ---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::

2016-11-21 15:58:56.854  INFO 43128 --- [           main] o.s.boot.SpringApplication               : Starting SpringApplication on ZT-AG-MBP with PID 43128 (/Users/and/Devel/Projects/spring-boot/spring-boot/target/classes started by and in /Users/and/Devel/Projects/spring-boot/spring-boot)
2016-11-21 15:58:56.858  INFO 43128 --- [           main] o.s.boot.SpringApplication               : No active profile set, falling back to default profiles: default
2016-11-21 15:58:56.863  WARN 43128 --- [           main] o.s.boot.SpringApplication               : Error handling failed (ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1f05fdd0: startup date [Thu Jan 01 01:00:00 CET 1970]; root of context hierarchy)
2016-11-21 15:58:56.875 ERROR 43128 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.IllegalArgumentException: Sources must not be empty
    at org.springframework.util.Assert.notEmpty(Assert.java:438) ~[spring-core-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:363) [classes/:na]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [classes/:na]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1161) [classes/:na]
    at org.springframework.boot.SpringApplication.main(SpringApplication.java:1177) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:523) [spring-boot-maven-plugin-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]

[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:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:523)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Sources must not be empty
    at org.springframework.util.Assert.notEmpty(Assert.java:438)
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:363)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1161)
    at org.springframework.boot.SpringApplication.main(SpringApplication.java:1177)
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.301 s
[INFO] Finished at: 2016-11-21T15:58:56+01:00
[INFO] Final Memory: 31M/362M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:run (default-cli) on project spring-boot: An exception occurred while running. null: InvocationTargetException: Sources must not be empty -> [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

0 个答案:

没有答案