• SpringBoot配合自动化部署修改内容


    1、修改application.yml配置文件中的profiles.active为变量形式

    spring:
      profiles:
        active: #spring.profiles.active#
    

    2、在pom.xml中增加profiles配置

        <profiles>
            <profile>
                <id>dev</id>
                <properties>
                    <spring.profiles.active>dev</spring.profiles.active>
                </properties>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
            </profile>
            <profile>
                <id>le-pre</id>
                <properties>
                    <spring.profiles.active>le-pre</spring.profiles.active>
                </properties>
            </profile>
            <profile>
                <id>le-pro</id>
                <properties>
                    <spring.profiles.active>le-pro</spring.profiles.active>
                </properties>
            </profile>
            <profile>
                <id>me-pre</id>
                <properties>
                    <spring.profiles.active>me-pre</spring.profiles.active>
                </properties>
            </profile>
            <profile>
                <id>me-pro</id>
                <properties>
                    <spring.profiles.active>me-pro</spring.profiles.active>
                </properties>
            </profile>
            <profile>
                <id>xye-pre</id>
                <properties>
                    <spring.profiles.active>xye-pre</spring.profiles.active>
                </properties>
            </profile>
            <profile>
                <id>xye-pro</id>
                <properties>
                    <spring.profiles.active>xye-pro</spring.profiles.active>
                </properties>
            </profile>
        </profiles>
    

    3、在pom.xml中增加resources配置

    <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**/xmldata/*.*</include>
                        <include>**/*.txt</include>
                        <include>**/*.yml</include>
                        <include>**/*.xml</include>
                        <include>**/log4j.properties</include>
                        <include>**/application-${spring.profiles.active}.properties</include>
                    </includes>
                    <filtering>true</filtering>
                </resource>
                <!--<resource>-->
                <!--<directory>src/main/resources.${spring.profiles.active}</directory>-->
                <!--<filtering>false</filtering>-->
                <!--</resource>-->
            </resources>
            <finalName>test-${spring.profiles.active}</finalName>
        </build>
    

    4、在pom.xml中增加properties配置

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <java.version>1.8</java.version>
            <skiptests>true</skiptests>
            <resource.delimiter>#</resource.delimiter>
        </properties>
    

    5、将配置文件统一放到resources.config文件夹中

     6、重启项目



  • 相关阅读:
    webview学习
    Android中webview html5 自动播放本地视频
    Android中使用WebView实现全屏切换播放网页视频
    Android中实现Activity的透明背景效果
    App过大
    Android 9.0网络权限适配
    Android中自定义环形图2
    Android中自定义环形图
    Android中自定义水球
    vue学习指南:第五篇(详细)
  • 原文地址:https://www.cnblogs.com/songjn/p/13354564.html
Copyright © 2020-2023  润新知