自定义上传项目选择配置: java -jar girl-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev
项目写的三个配置,一个application.yml,开发环境配置 application-dev.yml ,生产环境配置 application-prod.yml
写一个girl 实体类,并用@ConfigurationProperties(prefix = “girl”) 注解
备注:
但可能启动出错 Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled. ,出现这个错误加一个注解 @Component 就可以了