liqi___123 发表于 2013-1-31 02:49:00

ant学习二

<!--替换文件-->
<replace file="${dest.dir}/bme/WEB-INF/classes/jdbc.properties">
   <replacefilter token="@username@" value="${database.username}" />
   <replacefilter token="@password@" value="${database.encryptpassword}" />
  </replace>
 
<!--telnet和ftp-->
<target name="deployServer">
  <telnet server="${deploy.server}" userid="${deploy.user}" password="${deploy.password}" timeout="10">
<!--命令提示符如:linux (linux ls)-->(包括空格)
   <read string="${deploy.prompt}" />
     <write>cd ~</write>
   <read string="${deploy.prompt}" />
<write>cd tomcat</write>
   <read string="${deploy.prompt}" />
     </telnet>
 
<ftp server="${deploy.server}" userid="${deploy.user}" password="${deploy.password}" remotedir="tomcat/webapps" action="put">
   <fileset file="${deploy.dir}/aa.war" />
  </ftp>
</target>
页: [1]
查看完整版本: ant学习二