maven调用ant插件学习笔记

该博客介绍了如何在Maven的pom.xml中配置maven-antrun-plugin插件,以便在执行打包(package)阶段时自动运行Ant任务。这些任务包括创建目录、复制文件和目录,以及覆盖已有文件。这为项目构建过程提供了额外的定制能力。
摘要由CSDN通过智能技术生成
  1. 在pom中添加plugin
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version>
         <executions>
              <execution>
                  <!-- 执行打包操作时执行的任务 -->
                  <phase>package</phase>
                  <goals>
                        <goal>run</goal>
                  </goals>
                  <configuration>
                      <tasks>
                           <echo> 执行一些 Ant 任务:</echo>
                           <mkdir dir="xxx"/>
                           <copy file="test.properties" todir="xxx" overwrite="true" />
                           <copydir src="../xxx" dest="../yyy" />
                           <copy todir="../xxx" overwrite="true" >
                                <fileset dir="../xxx" />
                           </copy>
                      </tasks>
                  </configuration>
              </execution>
         </executions>
    </plugin>
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值