我想在构建后,使用Netbeans将一个文件复制到带有scp的远程服务器。
我现在手动做的是:
有什么方法可以使这个任务自动化吗?我试着查看build.xml文件,但它看起来确实像是我不想搞砸的东西。
谢谢
尼古拉
发布于 2009-11-18 22:23:05
我使用WinSCP来执行类似的操作。我监视本地目录中的文件更改,它会自动传输更改文件。
发布于 2013-09-16 23:26:54
这是可能的,请参阅ant站点上的scp任务:http://ant.apache.org/manual/Tasks/scp.html
网站的一个例子是:
Copy a set of files to a directory
<scp todir="user:password@somehost:/home/chuck">
<fileset dir="src_dir">
<include name="**/*.java"/>
</fileset>
</scp>
<scp todir="user:password@somehost:/home/chuck">
<fileset dir="src_dir" excludes="**/*.java"/>
</scp>
您可以在构建任务中硬核密码,但这不是一个好主意。最好用公钥。
https://stackoverflow.com/questions/1393066
复制相似问题