【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>
发布了168 篇原创文章 · 获赞 0 · 访问量 7836

猜你喜欢

转载自blog.csdn.net/weixin_42661815/article/details/100691161