While working on one of the project, I was tired of copying the files manually to remote server using SFTP tools.
I was wondering if Ant Builder is able to copy the files from one directory to other, it should also be able to copy to remote server.
After googling a bit, I found a bunch of answers, suggestions and finally, it worked for me.
The files from my local machine are now getting copied to remote server with Ant Build.
I just build my project in Eclipse and files get pushed to the server.
The only thing I need to do is; refresh the web page as the server development became the local development for me now.
Below are the step-wise instructions to Copy files to remote server using Ant Build:
- Download jsch.jar 0.1.55 jar.
- Add jsch.jar 0.1.55 jar to C:\eclipse_folder_path\plugins\org.apache.ant_1.10.8.v20200515-1239\lib folder.
- Go into the Eclipse Preferences, in the Ant/Runtime entry, in the 'Classpath' tab. Use the button 'Add External Jars' to add your jsch.jar to Ant's classpath.
- Add the below line to your Ant Build script instead of the copy command. <scp todir="user_name@remote_server_url:/path_to_remote_dir/" password="password" trust="true"</scp>
Comments
Post a Comment