标签:uil rect source resources vat image pom mave prope
找到pom.xml文件,在build节点下加入如下代码
<build> <resources> <resource> <directory>src/main/resources.${deploy.type}</directory> <excludes> <exclude>*.jsp</exclude> </excludes> </resource> <resource> <directory>src/main/resources</directory> </resource> </resources> </build>
然后再加入profiles节点,它和build节点同级
<profiles> <profile> <id>dev</id>//开发环境 <activation> <activeByDefault>true</activeByDefault>//默认是dev节点 </activation> <properties> <deploy.type>dev</deploy.type> </properties> </profile> <profile> <id>beta</id> <properties> <deploy.type>beta</deploy.type> </properties> </profile> <profile> <id>prod</id>//生产环境 <properties> <deploy.type>prod</deploy.type> </properties> </profile> </profiles>
maven projects里刷新,有如下所示:
创建如下所示文件夹,把不同环境下的不同配置文件单独列出一份:
标签:uil rect source resources vat image pom mave prope
原文地址:https://www.cnblogs.com/zhangliang1726/p/10205112.html