spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.41k stars 40.75k forks source link

mvn spring-boot:run error #16742

Closed sharing-sense closed 5 years ago

sharing-sense commented 5 years ago
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.0.RELEASE:run (default-cli) on project eladmin-system: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.1.0.RELEASE:run failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.0.RELEASE:run (default-cli) on project eladmin-system: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.1.0.RELEASE:run failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.1.0.RELEASE:run failed.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: java.lang.NullPointerException
        at java.io.File.<init>(File.java:277)
        at org.springframework.boot.maven.AbstractRunMojo.addUserDefinedFolders(AbstractRunMojo.java:445)
        at org.springframework.boot.maven.AbstractRunMojo.getClassPathUrls(AbstractRunMojo.java:431)
        at org.springframework.boot.maven.RunMojo.runWithMavenJvm(RunMojo.java:94)
        at org.springframework.boot.maven.AbstractRunMojo.run(AbstractRunMojo.java:249)
        at org.springframework.boot.maven.AbstractRunMojo.execute(AbstractRunMojo.java:198)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        ... 21 more
wilkinsona commented 5 years ago

It would appear that a null folder has been defined and stored in the folders array. Rather than just protecting against null, it would be useful to understand how and when that can happen. Can you please provide a small sample that reproduces the problem?

sharing-sense commented 5 years ago

I upgrade to lastest plugins is ok now

wilkinsona commented 5 years ago

Thanks for letting us know.

sharing-sense commented 5 years ago

I have installed a sanbox system in my win10 computer, so that will have this bug. in no sanbox system is run ok.

wilkinsona commented 5 years ago

Sorry, I don't understand what you mean by "sanbox system". If the problem still occurs in a certain situation when using the latest plugin, can you please describe exactly how to recreate that situation?