« »

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

打包好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

您还可能感兴趣的内容

日志信息 »

该日志于2010-06-23 22:55由 admin 发表在Java/jsp分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

没有评论

发表评论 »


返回顶部