R
rick bryant
all:
having trouble parsing quotes (") when running the ant exec target.
trying to build a goal in maven that executes an external pvcs command
to get a file from the pvcs repository. my exact goal looks like:
<goal name="gpc-pvcs-get">
<ant:exec executable="cmd.exe" path="d:/rbryant">
<ant:arg value="/c" />
<ant:arg value="cmdclient" />
<ant:arg value="-user ${pvcs.cmdclient.user}" />
<ant:arg value="-pass ${pvcs.cmdclient.pass}" />
<ant:arg value="-host ${pvcs.cmdclient.host}" />
<ant:arg value="-install ${pvcs.cmdclient.install}" />
<ant:arg value="-dbname ${pvcs.cmdclient.dbname}" />
<ant:arg value="-dbpass ${pvcs.cmdclient.dbpass}" />
<ant:arg value="-sqlnet ${pvcs.cmdclient.sqlnet}" />
<ant:arg value="-cmd ${pvcs.cmdclient.cmd}" />
</ant:exec>
</goal>
where:
pvcs.cmdclient.dbpass = \"\"
pvcs.cmdclient.cmd = \"FI GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\\downloads\\abyss\\AuthenticateUserForm.java\"
for some reason, the goal fails with a message that the pvcs
'cmdclient' command doesn't have all the required parameters and the
error that results is:
D:\rbryant>maven gpc-pvcs-get
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0-rc1-SNAPSHOT
gpc-pvcs-get:
[exec] Syntax: cmdclient [-user <id> -pass <password> -host
<server>
[exec] -install <directory> -dbname <database> -dbpass <password>
[exec] -sqlnet <identifier>] | [-param <parameter file>]
[exec] [-file <command file> | -cmd <Dimensions command>]
[exec] [-help] [-version] [-ascii | -binary]
[exec] [ERROR] Result: 1
BUILD SUCCESSFUL
Total time: 5 seconds
Finished at: Thu Nov 20 10:18:28 CST 2003
can execute the exact pvcs command from a dos shell without any
problems:
D:\downloads\abyss>cmd /c cmdclient -user rbryant -pass newguy -host
pvcshost1pc.internal.gxs.com -install /opt/pcms/dimensions7_1 -dbname
gpc_exp -dbpass "" -sqlnet pcms -cmd "FI GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\downloads\abyss\AuthenticateUserForm.java"
Operation completed
can also execute the exact pvcs command from a java class using the
exec() method from the Runtime class without any problems:
private void execute(){
String executable =
"cmd /c cmdclient -user rbryant -pass newguy -host
pvcshost1pc.internal.gxs.com -install /opt/pcms/dimensions7_1 -dbname
gpc_exp -dbpass \"\" -sqlnet pcms -cmd \"FI
GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\\downloads\\abyss\\AuthenticateUserForm.java\"";
Process process = null;
try{
process = Runtime.getRuntime().exec( executable );
}
catch( IOException ioe ) {
ioe.printStackTrace();
}
}
any ideas on how to get around the quote parsing problem in ant?
thanks very much,
rick
having trouble parsing quotes (") when running the ant exec target.
trying to build a goal in maven that executes an external pvcs command
to get a file from the pvcs repository. my exact goal looks like:
<goal name="gpc-pvcs-get">
<ant:exec executable="cmd.exe" path="d:/rbryant">
<ant:arg value="/c" />
<ant:arg value="cmdclient" />
<ant:arg value="-user ${pvcs.cmdclient.user}" />
<ant:arg value="-pass ${pvcs.cmdclient.pass}" />
<ant:arg value="-host ${pvcs.cmdclient.host}" />
<ant:arg value="-install ${pvcs.cmdclient.install}" />
<ant:arg value="-dbname ${pvcs.cmdclient.dbname}" />
<ant:arg value="-dbpass ${pvcs.cmdclient.dbpass}" />
<ant:arg value="-sqlnet ${pvcs.cmdclient.sqlnet}" />
<ant:arg value="-cmd ${pvcs.cmdclient.cmd}" />
</ant:exec>
</goal>
where:
pvcs.cmdclient.dbpass = \"\"
pvcs.cmdclient.cmd = \"FI GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\\downloads\\abyss\\AuthenticateUserForm.java\"
for some reason, the goal fails with a message that the pvcs
'cmdclient' command doesn't have all the required parameters and the
error that results is:
D:\rbryant>maven gpc-pvcs-get
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0-rc1-SNAPSHOT
gpc-pvcs-get:
[exec] Syntax: cmdclient [-user <id> -pass <password> -host
<server>
[exec] -install <directory> -dbname <database> -dbpass <password>
[exec] -sqlnet <identifier>] | [-param <parameter file>]
[exec] [-file <command file> | -cmd <Dimensions command>]
[exec] [-help] [-version] [-ascii | -binary]
[exec] [ERROR] Result: 1
BUILD SUCCESSFUL
Total time: 5 seconds
Finished at: Thu Nov 20 10:18:28 CST 2003
can execute the exact pvcs command from a dos shell without any
problems:
D:\downloads\abyss>cmd /c cmdclient -user rbryant -pass newguy -host
pvcshost1pc.internal.gxs.com -install /opt/pcms/dimensions7_1 -dbname
gpc_exp -dbpass "" -sqlnet pcms -cmd "FI GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\downloads\abyss\AuthenticateUserForm.java"
Operation completed
can also execute the exact pvcs command from a java class using the
exec() method from the Runtime class without any problems:
private void execute(){
String executable =
"cmd /c cmdclient -user rbryant -pass newguy -host
pvcshost1pc.internal.gxs.com -install /opt/pcms/dimensions7_1 -dbname
gpc_exp -dbpass \"\" -sqlnet pcms -cmd \"FI
GPC*EXP:A27991.A-SRC;bw49_3#1
/USER_FILENAME=d:\\downloads\\abyss\\AuthenticateUserForm.java\"";
Process process = null;
try{
process = Runtime.getRuntime().exec( executable );
}
catch( IOException ioe ) {
ioe.printStackTrace();
}
}
any ideas on how to get around the quote parsing problem in ant?
thanks very much,
rick