maven-antrun-plugin插件
来源:互联网 发布:php头部编码 编辑:程序博客网 时间:2024/06/05 03:19
转载自:http://www.mzone.cc
ant是一个老牌的项目打包管理系统了,目前虽然已经慢慢被maven取代,但其功能的强大仍然是很多场合下的首选,尤其是众多的task可以基本满足任何需求。其实在maven中也有使用ant的需求,比如不同环境打包编译时使用不同的配置信息等,或者是说做一些文件删除、复制之类的事情,这有些是maven做不来的,而ant就可以了,况且maven中已经有了maven-antrun-plugin插件,专门为在maven中运行ant做好了准备。
使用这个插件,只需要在项目的pom文件中定义如下插件片段:
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete file="${project.build.directory}/classes/abc.properties" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
这里,我们在maven的编译阶段执行一些文件的删除操作,比如将测试环境的配置文件删除,复制生产环境的配置文件等等,我们都可以使用ant的task来定义。通过ant的maven插件,可以将ant的强大功能也都引入到maven中来,实现二者的强强结合。
参考文档:
1、maven-antrun-plugin插件:http://maven.apache.org/plugins/maven-antrun-plugin/
2、ant的task列表总览:http://ant.apache.org/manual/tasksoverview.html
阅读全文
0 0
- maven-antrun-plugin插件
- Maven 插件之 maven-antrun-plugin
- maven-antrun-plugin(运行ant的插件)
- maven-antrun-plugin
- maven-antrun-plugin
- Maven antrun plugin 学习
- maven-antrun-plugin
- maven项目构建:maven-antrun-plugin插件实现文件内容拷贝和文件重命名
- Maven实战之antrun插件
- Maven实战之antrun插件
- Maven antrun plugin调用Ant Optional Task
- 如何在maven-antrun-plugin中使用if条件标签
- Apache Maven项目提供的AntRun插件详解
- Apache Maven项目提供的AntRun插件详解
- maven使用antrun运行不同版本的插件
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugi
- maven 导入No marketplace entries found to handle maven-antrun-plugin
- Maven: Maven Antrun Plugin configuration to copy package from target to basedir and rename it
- 牛客网(直通BAT面试算法班) 第三章,字符串,专题系列 Day4
- Ubuntu16.04+opencv3.3.0的安装配置说明
- quartz作业调度框架
- 10-1 JS案例:表单校验
- 基于矢量切片的电子地图配图(二)示例数据来源
- maven-antrun-plugin插件
- 装逼必备:大型分布式网站术语分析
- linux常用命令01--安装和开关机命令
- Squeezenet中添加OHEM层
- 我的Ruby学习历程之初识循环结构
- 基于模拟退火的遗传算法
- DP——51nod1020 逆序排列
- node.js操作MongoDB
- 牛客网(直通BAT面试算法班)第四章 队列与栈 Day5