Scripting 如何在ant脚本中获取ant任务的返回码?
我与mqfte合作。是否可以捕获我在ant脚本中使用的所有ant任务的返回代码?在FTE ant作业中,每个步骤都有一个Scripting 如何在ant脚本中获取ant任务的返回码?,scripting,ant,websphere,websphere-mq-fte,Scripting,Ant,Websphere,Websphere Mq Fte,我与mqfte合作。是否可以捕获我在ant脚本中使用的所有ant任务的返回代码?在FTE ant作业中,每个步骤都有一个成功规范。要继续执行该步骤,返回代码必须成功。如果作业失败,则将在日志条目中报告失败的返回代码 例如,在以下作业中,源代码前调用在传输之前对文件进行加密,如果传输成功,源代码后调用将删除文件的纯文本版本。根据定义,如果传输失败,将在FTE日志中报告非零返回代码。否则调用成功,我们知道返回码都是零 <request version="4.00" xmlns:xsi="htt
成功规范。要继续执行该步骤,返回代码必须成功。如果作业失败,则将在日志条目中报告失败的返回代码
例如,在以下作业中,源代码前调用在传输之前对文件进行加密,如果传输成功,源代码后调用将删除文件的纯文本版本。根据定义,如果传输失败,将在FTE日志中报告非零返回代码。否则调用成功,我们知道返回码都是零
<request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<managedTransfer>
<originator>
<hostName>${hostName}</hostName>
<userID>${userID}</userID>
</originator>
<sourceAgent QMgr="${sourceQM}" agent="${sourceAgent}"/>
<destinationAgent QMgr="${destQM}" agent="${destAgent}"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="Cost_Center">1234</metaData>
</metaDataSet>
<preSourceCall>
<command type="executable" name="/usr/bin/gpg" successRC="0">
<argument>-es</argument>
<argument>--batch</argument>
<argument>-r</argument>
<argument>${signame}</argument>
<argument>--output</argument>
<argument>${FILEPATH}.gpg</argument>
<argument>--passphrase-file</argument>
<argument>${pwdfile}</argument>
<argument>${FILEPATH}</argument>
</command>
</preSourceCall>
<postSourceCall>
<command type="executable" name="/var/IBM/WMQFTE/user/ant/rm" successRC="0">
<argument>${FILEPATH}</argument>
</command>
</postSourceCall>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>${FILEPATH}.gpg</file>
</source>
<destination exist="overwrite" type="directory">
<file>${targetDir}</file>
</destination>
</item>
</transferSet>
<job>
<name>gpge.xml</name>
</job>
</managedTransfer>
</request>
${hostName}
${userID}
1234
-es
--批处理
-r
${signame}
--输出
${FILEPATH}.gpg
--密码短语文件
${pwdfile}
${FILEPATH}
${FILEPATH}
${FILEPATH}.gpg
${targetDir}
gpge.xml
在FTE Ant作业中,每个步骤都将有一个成功rc
规范。要继续执行该步骤,返回代码必须成功。如果作业失败,则将在日志条目中报告失败的返回代码
例如,在以下作业中,源代码前调用在传输之前对文件进行加密,如果传输成功,源代码后调用将删除文件的纯文本版本。根据定义,如果传输失败,将在FTE日志中报告非零返回代码。否则调用成功,我们知道返回码都是零
<request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<managedTransfer>
<originator>
<hostName>${hostName}</hostName>
<userID>${userID}</userID>
</originator>
<sourceAgent QMgr="${sourceQM}" agent="${sourceAgent}"/>
<destinationAgent QMgr="${destQM}" agent="${destAgent}"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="Cost_Center">1234</metaData>
</metaDataSet>
<preSourceCall>
<command type="executable" name="/usr/bin/gpg" successRC="0">
<argument>-es</argument>
<argument>--batch</argument>
<argument>-r</argument>
<argument>${signame}</argument>
<argument>--output</argument>
<argument>${FILEPATH}.gpg</argument>
<argument>--passphrase-file</argument>
<argument>${pwdfile}</argument>
<argument>${FILEPATH}</argument>
</command>
</preSourceCall>
<postSourceCall>
<command type="executable" name="/var/IBM/WMQFTE/user/ant/rm" successRC="0">
<argument>${FILEPATH}</argument>
</command>
</postSourceCall>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>${FILEPATH}.gpg</file>
</source>
<destination exist="overwrite" type="directory">
<file>${targetDir}</file>
</destination>
</item>
</transferSet>
<job>
<name>gpge.xml</name>
</job>
</managedTransfer>
</request>
${hostName}
${userID}
1234
-es
--批处理
-r
${signame}
--输出
${FILEPATH}.gpg
--密码短语文件
${pwdfile}
${FILEPATH}
${FILEPATH}
${FILEPATH}.gpg
${targetDir}
gpge.xml
@Martin。属性rcproperty不适用于所有ant任务。除此之外,如何获取返回码?@Martin。属性rcproperty不适用于所有ant任务。除此之外,如何捕获返回代码?