SpringBoot + Maven 环境配置 Admin - SpringBoot + Maven 多启动环境配置实例详解

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

SpringBoot + Maven 环境配置 Admin - SpringBoot + Maven 多启动环境配置实例详解

EPIC_MELODY   2021-03-29 我要评论
想了解Admin - SpringBoot + Maven 多启动环境配置实例详解的相关内容吗,EPIC_MELODY在本文为您仔细讲解SpringBoot + Maven 环境配置的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:SpringBoot,Maven,环境配置,SpringBoot,Maven,多环境配置,下面大家一起来学习吧。

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

<profiles>
  <profile>
    <id>dev</id>
    <properties>
      <profiles.active>dev</profiles.active>
    </properties>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
  </profile>
  <profile>
    <id>telework</id>
    <properties>
      <profiles.active>telework</profiles.active>
    </properties>
  </profile>
  <profile>
    <id>sit</id>
    <properties>
      <profiles.active>sit</profiles.active>
    </properties>
  </profile>
  <profile>
    <id>pre</id>
    <properties>
      <profiles.active>pre</profiles.active>
    </properties>
  </profile>
  <profile>
    <id>prod</id>
    <properties>
      <profiles.active>prod</profiles.active>
    </properties>
  </profile>
</profiles>

二:application.properties

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

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们