【SpringBoot】啓動報錯:No active profile set, falling back to default profiles: default

使用Mac Idea創建springBoot工程,創建完畢啓動日誌如下:

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -XX:TieredStopAtLevel=1 -noverify-

Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -

Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath

加載各種****.jar包

com.monkey.yb.springdemo.SpringdemoApplication

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

2019-09-10 10:08:50.961  INFO 648 --- [ main] c.m.yb.springdemo.SpringdemoApplication  : Starting SpringdemoApplication on zhujunfengdeMacBook-Pro.local with PID 648 
2019-09-10 10:08:50.963  INFO 648 --- [main] c.m.yb.springdemo.SpringdemoApplication  : No active profile set, falling back to default profiles: default
2019-09-10 10:08:51.324  INFO 648 --- [main] c.m.yb.springdemo.SpringdemoApplication  : Started SpringdemoApplication in 15.609 seconds (JVM running for 21.159)

Process finished with exit code 0
 

此問題產生的原因是缺少springBoot-web依賴,在pom.xml文件中添加spring-boot-starter-web即可,如下:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章