经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 软件/图像 » Maven » 查看文章
Admin - SpringBoot + Maven 多启动环境配置实例详解
来源:jb51  时间:2021/3/29 10:20:56  对本文有异议

一:父级pom.xml文件 resources目录下新建指定文件夹,存放Spring配置文件

  1. <profiles>
  2. <profile>
  3. <id>dev</id>
  4. <properties>
  5. <profiles.active>dev</profiles.active>
  6. </properties>
  7. <activation>
  8. <activeByDefault>true</activeByDefault>
  9. </activation>
  10. </profile>
  11. <profile>
  12. <id>telework</id>
  13. <properties>
  14. <profiles.active>telework</profiles.active>
  15. </properties>
  16. </profile>
  17. <profile>
  18. <id>sit</id>
  19. <properties>
  20. <profiles.active>sit</profiles.active>
  21. </properties>
  22. </profile>
  23. <profile>
  24. <id>pre</id>
  25. <properties>
  26. <profiles.active>pre</profiles.active>
  27. </properties>
  28. </profile>
  29. <profile>
  30. <id>prod</id>
  31. <properties>
  32. <profiles.active>prod</profiles.active>
  33. </properties>
  34. </profile>
  35. </profiles>

二:application.properties

  1. ######################### server ###################
  2. server.servlet.context-path=/i-admin-api
  3. server.port=10086
  4. spring.profiles.active=@profiles.active@

到此这篇关于Admin - SpringBoot + Maven 多启动环境配置实例详解的文章就介绍到这了,更多相关SpringBoot + Maven 环境配置内容请搜索w3xue以前的文章或继续浏览下面的相关文章希望大家以后多多支持w3xue!

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号