Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Strange property problem

Strange property problem

2007-05-31       - By Kevin Jackson
Reply:     1     2     3     4  

Hi all,

I have a weird error caused by a property being wrong 50% of the time
and correct 50% of the time.

here's the relevant code:

<macrodef name="ssh-cmd">
      <attribute name="command"/>
      <attribute name="fail" default="true"/>
        <sshexec host="${deploy.machine.address}" port="${deploy.machine.ssh.port}"
            username="root" password="${deploy.machine.root.user.password}"
            failonerror="@{fail}" trust="true"/>

<ssh-cmd command="cd /var;tar xzvpf
/root/james-${james.version}.tar.gz;chown -R james:james

the <echo> produces the following:


in the ssh-cmd, the output of the tar xzvpf /root/james-${james.version}.tar.gz

tar xzvf /root/james-server-next-major.tar.gz

finally the chown -r james:james ${}
fails with /var/james/james-server-binary-next-major doesn't exist

so the echo thinks that ${james.version} = server-binary-next-major
the ssh-cmd macro thinks :
1 - ${james.version} = server-next-major
2 - then ${james.version} = server-binary-next-major

With ant properties are immutable, so what the hell is happening?


To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.