现在的位置: 首页 > 综合 > 正文

ant学习(存档)

2013年01月11日 ⁄ 综合 ⁄ 共 1882字 ⁄ 字号 评论关闭

ANT = [A]nother [N]eat [T]ool 
This plugin provides the ability to run Ant tasks from within Maven. You can even embed your Ant scripts in the POM
需要经常编写ant脚本,为此需要学习下ant的脚本。
在maven项目中最常见的用法:
     <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                         <execution>
                              <phase>process-test-resources</phase>
                              <goals>
                                   <goal>run</goal>
                              </goals>
                              <configuration>
                                   <target>
                                        <delete dir="${basedir}/src/java.test/spring/conf" />
                                        <mkdir dir="${basedir}/src/java.test/spring/conf" />
                                        <copy todir="${basedir}/src/java.test/spring/conf">
                                             <fileset dir="${basedir}/target/conf/webroot/WEB-INF/bean/">
                                                  <include name="**" />
                                             </fileset>
                                        </copy>
                                        <move file="${basedir}/target/conf/java/sqlmap-config.xml"
                                             tofile="${basedir}/src/java.test/spring/web.sqlmap-config.xml"
                                             overwrite="true" />
                                   </target>
                              </configuration>
                         </execution>
                    </executions>
       </plugin>

抱歉!评论已关闭.