java 开发 idea spring->resource添加多个资源配置文件夹
来源:互联网 发布:php request method 编辑:程序博客网 时间:2024/06/06 05:13
环境:dev、test、pre、prod
文件夹:resource-ad、resource-push
最终的样式如下:
1.先建立如上的文件夹结构,并放置相应的property
2.进入pom.xml,添加相应的资源目录:
<resources> <resource> <directory>src/main/resources-push/resources.${deploy.type}</directory> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources-ad/resources.${deploy.type}</directory> <filtering>true</filtering> </resource></resources>
3.pom.xml文件中增加相应的profiles
<profiles> <profile> <id>dev</id> <properties> <deploy.type>dev</deploy.type> </properties> </profile> <profile> <id>dev-ad</id> <properties> <deploy.type>dev-ad</deploy.type> </properties> </profile> <profile> <id>test</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <deploy.type>test</deploy.type> </properties> </profile> <profile> <id>test-ad</id> <properties> <deploy.type>test-ad</deploy.type> </properties> </profile> <profile> <id>pre</id> <!--<activation>--> <!--<activeByDefault>true</activeByDefault>--> <!--</activation>--> <properties> <deploy.type>pre</deploy.type> </properties> </profile> <profile> <id>pre-ad</id> <properties> <deploy.type>pre-ad</deploy.type> </properties> </profile> <profile> <id>prod</id> <properties> <deploy.type>prod</deploy.type> </properties> </profile> <profile> <id>prod-ad</id> <properties> <deploy.type>prod-ad</deploy.type> </properties> </profile> </profiles>
阅读全文
0 0
- java 开发 idea spring->resource添加多个资源配置文件夹
- Spring Resource 读取资源配置文件
- idea创建多个maven项目java文件夹不是绿色
- Spring-----多环境中加载资源配置文件
- IDEA添加阿里巴巴Java开发规约插件
- spring mvc 静态资源配置
- Spring Boot学习--资源配置
- 5.Magento资源配置(Setup Resource)
- IDEA 开发Spring项目
- java中的资源配置文件
- Spring Security资源配置入门讲解
- 如何在IDEA启动多个Spring Boot工程实例
- 资源配置
- IDEA开发第一个Servlet
- idea结合maven开发spring
- idea 开发spring boot应用程序
- IntelliJ IDEA开发Spring mvc
- Java开发工具 idea
- 001_Java语言基础知识
- IO模型
- C++primer5 题3.25
- 动态规划-入门篇
- 全文搜索引擎 Elasticsearch 入门教程
- java 开发 idea spring->resource添加多个资源配置文件夹
- 浅谈数据分库分表之道
- intellij IDEA右键没有Git或svn处理方法
- hdoj 2066 一个人的旅行
- 关于在python中, 在同一个project中的同一个目录里面, 导入模块的问题
- 3 栈和队列-栈的定义(待更改)
- ### Error building SqlSession. ### The error may exist in sqlmap/User.xml
- C++之父:C++ 的五个普遍误解(1)
- chapter22_2