maven filters 和 resource
1 filter
1.1 用途
对多个配置文件进行选择。
1.2 选择的依据
1.3 使用的方式
第一,在<resource>标签下面加<filtering>标签,并且<filtering>标签的值设置为true;
第二,添加<filters>标签,添加<filter>,并且值中使用env变量
第三,在profiles中添加相应的profile,并且给env赋值
这样,mvn -P prod指定了prod的话,就会选择相应的profile,然后给env赋值,然后选择了相应的filter。
1.4 filters和resource、filtering、include
当resource设置了filtering为true的时候,会使用filters中设置的fliter来过滤该resource下include的文件中的变量。
也就是说,filtering是是否过滤的开关,filters中指定过滤用的filter,include指定被过滤的对象。这些变量的替换是maven执行的。
2 resource
指定哪些文件会包含在war文件中。
maven filters 和 resource的更多相关文章
- maven工程读取resource下配置文件
maven工程读取resource下配置文件 在maven工程中,我们会将配置文件放到,src/main/resources 下面,例如 我们需要确认resource 下的文件 编译之后存放的位置 ...
- Maven学习笔记(十二)-maven打包之resource配置
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u011781521/article/details/79052725 一.简介 构建Maven项目的 ...
- [转]ASP.NET Core Exception Filters and Resource Filters
本文转自:https://damienbod.com/2015/09/30/asp-net-5-exception-filters-and-resource-filters/ This article ...
- 【maven】Description Resource Path Location Type An error occurred while filtering resources TESTVIDEO line
在maven中构建项目的时候发现了如下错误: Description Resource Path Location Type An error occurred while filtering res ...
- Maven 工程读取resource下的文件
1:方式1: public static List<String> userList; static { userList = new LinkedList<String>() ...
- 奇葩问题 eclipse下 maven项目 java Resource报个小红叉,然而里面却没有小红叉
之前没注意,不知是一开始就有还是这两天才有,说下解决方案: 右击项目“Properties”,在弹出的“Properties”的左侧边框,单击“Project Facets”,打开“Project F ...
- maven profiles、filters、resources学习笔记 及 常用 plugin demo
这里只记了学习以下博客后,自己做的一个总结. 来源:http://blog.csdn.net/fengchao2016/article/details/72726101 profiles定义了一些不同 ...
- maven引入多个spring jar包中存在同名文件的问题
项目打包后执行报错:Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespaceht ...
- maven打包
1.利用maven-jar-plugin <build> <plugins> <!-- The configuration of maven-jar-plugin --& ...
随机推荐
- iOS开发:解决UIScrollView不滚动的问题
照着书上的Demo(iOS 5.0的教程),在- (void)viewDidLoad里设置scrollView的contentsize,让它大于屏幕的高度,却发现在模拟器中没用,还是不能滚.经过 一翻 ...
- nonlocal(非局部变量)---python 3.x 新增关健词
Python里只有2种作用域:全局作用域和局部作用域.全局作用域是指当前代码所在模块的作用域,局部作用域是指当前函数或方法所在的作用域.其实准确来说,Python 3.x引入了nonlocal关键字, ...
- (九)Thymeleaf用法——Themeleaf注释
4. 注释 模板名称:comment.html 4.1 标准 HTML/XML注释 语法:<!-- --> 4.2 解析器级注释块(Parser-level ...
- dispatch_after中时间的计算
dispatch_after中用的时间是纳秒,所以需要进行转换:desDelayInSeconds(目标时间,比如2s)* NSEC_PER_SEC double delayInSeconds = 0 ...
- Java 下载JDK账号
目前在官网下载低于jdk1.8的Javajdk的时候需要登陆,这边分享一个账号,方便下载 账号:2696671285@qq.com 密码:Oracle123 javajdk下载地址:点击打开链接
- 2.JAVA编程思想——一切都是对象
一切都是对象 欢迎转载.转载请标明出处:http://blog.csdn.net/notbaron/article/details/51040221 虽然以C++为基础,但 Java 是一种更纯粹的面 ...
- SpringBoot使用MyBatis报错:Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL)
© 版权声明:本文为博主原创文章,转载请注明出处 1. 错误描述 使用SpringBoot集成MyBatis框架,并且使用 mapper-spring-boot-starter 自动生成MyBati ...
- 在oracle11g中配置多个DataGuard物理备机
>> from zhuhaiqing.info 主机配置 alter system set DB_UNIQUE_NAME='starboss' scope=spfile; alter sy ...
- lua学习笔记(四)
表达式 算术操作符 +(加法) -(减法) *(乘法) /(除法) ^(指数) %(取模) -(负号) x%1的结果是x的小数部分,x-x%1是整数部分 关系操作符 ...
- Android linux kernel privilege escalation vulnerability and exploit (CVE-2014-4322)
In this blog post we'll go over a Linux kernel privilege escalation vulnerability I discovered which ...