标签类目:ant

ant应用举例—远程部署web应用

分类:Java/jsp打包好web应用时,有时候上传也是比较烦琐,ant需要jsch.jar,可以到SourceForge:jsch,把它放到ant能找到地方,可以放到ANT_HOME/lib下。

然后写target:

  1. <target name="copy.to.remote" depends="war">
  2.     <scp file="${build.dir}/${project.name}.war" todir="${scp.username}:${scp.passwd}@${scp.host}:${scp.path}" port="22" trust="true" verbose="true"></scp>
  3. </target>

延伸:

•使用时报 com.jcraft.jsch.JSchException: reject HostKey: 192.168.0.123。是没有加 trust=”true”,把它加上就好了。
•在 eclipse 中加 ant 额外的lib:首选项->Ant->Runtime->ClassPath->Global Entries,添加额外的jar

ant应用举例—执行源码补丁任务

分类:Java/jsp发布的软件难免会有 bug。修改好 bug 后,没有提交到 svn 中,可以生成一个补丁文件,就可以发布这个补丁文件了。我们 down 到补丁文件后,就可fix bug了。比较开源软件的 patch。现我用 hello world 程序来示例下 ant 怎么让程序打上补丁。

假如已经发布了一个软件程序,HelloWorld.java:

继续阅读 »


返回顶部