1 使用常见的Ant任务
<target name="db:create" depends="filterSqlFiles" description="Create the database definition"> <sql driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306" userid="root" password="root" classpathref="db.lib.path" src="${filtered.sq.dir}/database-defination.sql" delimiter="//"/> </target>
2 delete任务
<delete file="c:\tmp" />
3 jar任务
<jar destfile="${jarName}"> <fileset dir="classes" /> </jar>
4 scp(shell copy)任务
需要将这3个jar放在classpath
- jsch.jar
- commons-net.jar
- commons-codec.jar
<scp todir="admin:fuwei@192.168.206.134:~/vbird" trust="true"> <fileset file="研究交易三期PRD.txt" /> <fileset dir="工作流引擎"/> </scp>
5 sshexec(shell execute)任务
<sshexec host="192.168.207.170" username="hadoop" password="hadoop" trust="true" command="cd /; ls -aF" />
6 ftp任务
<ftp server="192.168.207.170" userid="hadoop" password="hadoop" remotedir="hdfile/src/loganalyse/HadoopLogAnalyse"> <fileset dir="src" /> </ftp>