Maven使用之profile
来源:互联网 发布:安全课 防火知多少 编辑:程序博客网 时间:2024/05/01 04:12
企业开发环境通常会有多套,有开发环境,测试环境,预发布环境,生产环境,还有一种叫法是staging环境,sit环境,prep环境,production环境。在不同环境下通唱需要使用一些不同的配置,那么怎样做到这些配置相互独立,而且方便替换呢,maven提供的profile配置就可以实现。
<profiles> <profile> <id>dev</id> <properties> <env>dev</env> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>test</id> <properties> <env>test</env> </properties> </profile> <profile> <id>production</id> <properties> <env>production</env> </properties> </profile> </profiles> ... <build> <filters> <filter>../parent/src/main/filters/filter-${env}.properties</filter> </filters> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>**/*.ftl</exclude> <exclude>**/*-dynamic.xml</exclude> <exclude>**/mybatis/**/*.xml</exclude> </excludes> </resource> </resources> </build>
在执行 mvn package -P dev的时候,会对resource下的directory所配置的目录,使用filter中的dev.properties进行变量替换。
其中会排除excludes下配置的文件。
0 0
- Maven使用之profile
- Maven之Profile详解
- maven之profile
- maven 之 profile
- Maven 之 profile
- Maven Profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile的使用
- maven profile 使用
- Maven提高篇系列之四——使用Profile
- Maven提高篇系列之四——使用Profile
- Maven提高篇系列之四——使用Profile
- OpenCV&Qt学习之四——OpenCV 实现人脸检测与相关知识整理
- Mybatis-Spring 的高级配置 (SqlSessionFactoryBean)
- 加1乘2平方
- Kubernetes实践(2)--hello world 示例
- OpenGL(九) 三维混色和深度缓存设置
- Maven使用之profile
- 读《四世同堂》有感
- bootstrap模态框传值问题
- arm-linux-strip
- Android okHttp框架
- 【腾讯云的1001种玩法】利用腾讯云快速搭建一个Alerts服务
- 六数码问题
- Java 三种会抛 ConcurrentModificationException 异常的代码实例
- 利用surfaceview实现示波器WaveView