2

Spring Boot guide presents a demo example where to run the application ./mvnw spring-boot:run command inside the 'complete' folder/directory is used, in the case we are using the build framework maven. I tried this command from my windows power shell as well as command prompt but it displays the message "Spring was unexpected this time."

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

I am using Windows 7. The command prompt contents are as follows:

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>
Sharad Nanda
  • 406
  • 1
  • 15
  • 27
  • I suspect the problem is due to you running your commands from a directory containing spaces in its name. Try running it from a directory that doesn't contain spaces. – Luke Woodward Mar 06 '21 at 20:04
  • This seems like an issue with your maven path. Please refer to this post https://stackoverflow.com/questions/34631826/maven-files-was-unexpected-at-this-time/54249525 – Arv Mar 07 '21 at 06:13

1 Answers1

0

I am able to run the application with the help of following command:

mvn spring-boot:run
Sharad Nanda
  • 406
  • 1
  • 15
  • 27