0

I have the following exec tag in my build xml file -

<exec "ssh ${sshUserName}@${sshHost} 'ls -l'" outputProperty="fileListTemp" dir="." />

Running the build gives me error on this line -

BUILD FAILED
/mnt/home/sandeepan/test_phing_build/build.xml:83:15: > required

I am not able to understand the error.

Note - I am not using the SshTask because I do not have PHP SSH2 extension installed, and I am not installing it because I don't know whether I actually need it.

I followed the syntax given in this answer - https://stackoverflow.com/a/21427332/351903

Community
  • 1
  • 1
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144

1 Answers1

0

That's invalid XML. You're missing the attribute name for your command. It's either command or executable according to the documentation.

command:

<exec
    command="ssh ${sshUserName}@${sshHost} 'ls -l'"
    outputProperty="fileListTemp"
    dir="."
/>

executable:

<exec executable="ssh" outputProperty="fileListTemp" dir=".">
    <arg value="${sshUserName}@${sshHost}" />
    <arg value="ls -l" />
</exec>

I'd also recommend using the checkreturn switch (checkreturn="true") to let the build fail if the command failed.

Kontrollfreak
  • 1,800
  • 12
  • 24