【问题标题】:./mvnw spring-boot:run command displays "Spring was unexpected this time" message./mvnw spring-boot:run 命令显示“这次 Spring 是意外的”消息
【发布时间】:2021-03-06 18:08:11
【问题描述】:

Spring Boot guide 提供了一个运行应用程序的演示示例。在我们使用构建框架 maven 的情况下,使用“完整”文件夹/目录中的 /mvnw spring-boot:run 命令。我从我的 windows power shell 以及命令提示符中尝试了这个命令,但它显示消息“这次 Spring 是意外的。”

E:
├───src
    ├───main
    │   ├───java
    │   │   └───com
    │   │       └───example
    │   │           └───demo
    │   └───resources
    └───test
        └───java
            └───com
                └───example
                    └───demo

我使用的是Windows 7,命令提示符内容如下:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
E:\MyLearnings(Tech Front)\Spring Boot Learning\gs-spring-boot-master\gs-spring-boot-master\complete>mvnw spring-boot:run
\Spring was unexpected at this time.
    
E:\MyLearnings(Tech Front)\Spring Boot Learning\gs-spring-boot-master\gs-spring-boot-master\complete>./mvnw spring-boot:run
'.' is not recognized as an internal or external command, operable program or batch file.
    
E:\MyLearnings(Tech Front)\Spring Boot Learning\gs-spring-boot-master\gs-spring-boot-master\complete>.\mvnw spring-boot:run
\Spring was unexpected at this time.
    
E:\MyLearnings(Tech Front)\Spring Boot Learning\gs-spring-boot-master\gs-spring-boot-master\complete>

【问题讨论】:

  • 我怀疑问题是由于您从名称中包含空格的目录运行命令所致。尝试从不包含空格的目录运行它。
  • 这似乎是您的 Maven 路径的问题。请参考此帖stackoverflow.com/questions/34631826/…

标签: java spring windows spring-boot maven


【解决方案1】:

我可以在以下命令的帮助下运行应用程序:

mvn spring-boot:run

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-12
    • 2015-02-02
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2016-03-10
    • 2019-05-24
    相关资源
    最近更新 更多