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 --& ...
随机推荐
- Java迭代器原理
1迭代器模式 迭代器是一种设计模式,这种模式用于顺序访问集合对象的元素,不需要知道集合对象的底层表示. 一般实现方式如下:(来自)
- jquery给多个span赋值
因为我想在页面载入完毕后,有几个地方显示当前时间,所以我须要给多个span赋值. span代码的写法例如以下: <span name="currentDate">< ...
- Google Chrome 35 Released – Install on RHEL/CentOS 6 and Fedora 20-15
Google Chrome is a freeware web browser developed by Google Inc. Google Chrome team proudly announce ...
- react-native 扫一扫功能(二维码扫描)功能开发
1.安装插件 yarn add react-native-smart-barcode 2.关联 react-native link react-native-smart-barcode 3.修改 an ...
- Mac环境下反编译apk
0,工具汇总 我们反编译apk主要使用下面三个工具 apktool:用于获取资源文件 dex2jar:获取源文件jar包 JD-GUI:反编译源文件jar包查看源码 找这些工具时折腾了我点时间.如今把 ...
- js:获得时间
<script type="text/javascript"> function bodyLoad() { var dateTime = new Date(); var ...
- 通用对话弹窗CommonDialog
代码地址如下:http://www.demodashi.com/demo/12592.html 通用对话弹窗CommonDialog Version 1.0 Created by chenchangj ...
- NoSQL之Redis学习小结
大数据时代要求: 三V:Volume海量.Velocity实时.Variety多样: 三高:高并发.高可扩.高性能 高并发操作不建议使用关联查询,而使用冗余数据,分布式系统支持不了太多的并发. 横向 ...
- css进阶读书笔记
说明:努力在十一左右,最迟双11之前掌握所有css知识要点 一.摘自<写给大家看的CSS书(第2版)>(虽然书比较旧,09年版的,但对于我这种刚入门的小菜鸟 来说,能学到的还是挺多的) 1 ...
- NSTimer注意内存泄露(真该死)
NSTimer可以用来执行一些定时任务,比较常用的方法就是: + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTar ...