Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ANT:在webspheremessagebroker中自动创建BAR文件_Ant_Messagebroker - Fatal编程技术网

ANT:在webspheremessagebroker中自动创建BAR文件

ANT:在webspheremessagebroker中自动创建BAR文件,ant,messagebroker,Ant,Messagebroker,我正在尝试自动创建BAR文件,我希望从用户处接受多个值,将其存储在某个列表或数组中,然后单独使用ANT脚本中的所有变量。下面是我正在尝试的脚本: <?xml version="1.0" encoding="UTF-8"?> <project xmlns:ac="antlib:net.sf.antcontrib" name="AirLineReservation" default="acceptInputs"> <target name="run"

我正在尝试自动创建BAR文件,我希望从用户处接受多个值,将其存储在某个列表或数组中,然后单独使用ANT脚本中的所有变量。下面是我正在尝试的脚本:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:ac="antlib:net.sf.antcontrib"
    name="AirLineReservation" default="acceptInputs">
    <target name="run" description="BAR File Generation">
        <property name="toolkit.home" value="C:/Program Files (x86)/IBM/WMBT800" />
        <property name="ant.library.dir" value="C:/Manju/apache-ant-1.8.4/lib"/>
    </target>

    <target name="acceptInputs" description="Accepts inputs from user">
        <taskdef
            uri="antlib:net.sf.antcontrib"
            resource="net/sf/antcontrib/antlib.xml">
              <classpath>
                <pathelement location="${ant.library.dir}/ant-contrib-1.0b3.jar" />
              </classpath>
         </taskdef>
         <input message="Enter Workspace Directory" addproperty="workspace.dir"/>
         <echo message= " Workspace dir : ${workspace.dir} "/>
         <input message="Enter Project name" addproperty="project.name"/>
         <echo message= "Project Name : ${project.name} "/>
         <input message="Enter Name of BAR file to be created" addproperty="bar.name"/>
         <echo message= " Bar File Name : ${bar.name} "/>
         <input message="Enter number of resources You want to add ( In Numbers )" addproperty="numberofresources"/>
         <echo message= " Number of Resources : ${numberofresources} "/>
         <ac:for param="i" end="${numberofresources}">
           <sequential>
                <input message="Enter Resource Name" addproperty="resource@{i}"/>
                <echo>Resource: resource@{i} : ${resource@{i}}</echo>
           </sequential>
         </ac:for>
        <echo message="Building the Message Broker Project @ ${workspace.dir}" />
        <exec executable="${toolkit.home}/mqsicreatebar.exe" failonerror="true">
                    <arg value="-data" />
                    <arg value="${workspace.dir}" />
                    <arg value="-b" />
                    <arg value="${bar.name}" />
                    <!-- List all the message flow projects -->

                    <arg value="-p" />
                    <arg value="${project.name}" />

                    <!-- List all the files to be included in the archive -->
                    <arg value="-o" />
                    <ac:for param="i" end="${numberofresources}">
                       <sequential>
                            <arg value="${resource@i}" />
                       </sequential>
                    </ac:for>
                </exec>

    </target>

</project>

Resource:Resource@{i}:${Resource@{i}
在上面的脚本中,需要传递我从用户接受的所有资源作为参数。 exec将不允许嵌套for循环。
所以请帮助我将资源的所有值作为参数传递给exec

你找到解决办法了吗?这似乎是一个很老的问题。。。