zoukankan      html  css  js  c++  java
  • Maven -- 在进行war打包时用正式环境的配置覆盖开发环境的配置

    我们的配置文件一般都放在  src/main/resource 目录下。 

    假定我们的正式环境配置放在 src/main/online-resource 目录下。

    那么打成war包时,我们希望用online-resource下的配置文件取代resource 下的配置文件。

    pom.xml 插件配置:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <warName>${project.build.finalName}</warName>
                        <webResources>
                            <resource>
                                <directory>src/main/online_resources</directory>
                                <targetPath>WEB-INF/classes</targetPath>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>

    配置的意思就是把 src/main/online_resources 目录下的文件输出到 WEB-INF/classes 。 那么online_resources中的文件就会把resource中的相同的配置文件覆盖掉。

  • 相关阅读:
    to_char &&to_date
    java中Integer 与 String 类型的 相互 转换
    group by 的用法
    谈 计算时间的天数差
    领域建模
    Java Classloader详解
    阿里巴巴Java招聘
    Maven Archetype
    负载均衡
    Maven
  • 原文地址:https://www.cnblogs.com/zsg88/p/7609440.html
Copyright © 2011-2022 走看看