Developers, Developers, Developers! Maksim Sorokin IT Blog


Copy Files with SCP Using Maven

You can use Maven AntRun Plugin and Ant SCP task in order to transfer files with SCP:

            <scp todir="${scp.user}:${scp.password}@${}:/${scp.dirCopyTo}" trust="true" failonerror="false">
              <fileset dir="${bundle.dir}" />

Alternatively, you can use Ant sshexec command in order to do additional stuff through SSH, like create or remove folders.

Tagged as: , , , Comments Off
Comments (2) Trackbacks (0)
  1. I am looking to SCP files and directories just like you have above. I have setup like you outlined above but it appears the copy never finishes.
    I don’t get the “Build Successful message any longer with this task added.
    Any suggestions??

  2. What do you mean “copy never finishes”? Can you copy maven output?
    Do you see any connection attempts from the server?

Leave a comment

Trackbacks are disabled.