如何将可变数量的参数传递给ant exec

Pat*_*Pat 6 java ant

我有一个ant目标,它接受一些可传递给exec任务的可变参数.使用旧机制它是微不足道的:

<exec command="cmd /c ${_full-path-to-exec}" osfamily="windows" failonerror="true">
</exec>
Run Code Online (Sandbox Code Playgroud)

但是,不推荐使用'command'来支持嵌套元素.像这样:

<exec executable="cmd" osfamily="windows" failonerror="true">
    <arg value="/c"/>
    <arg file="${_full-path-to-exec}"/>
    <arg value="${_param-one}"/>
    <arg value="${_param-two}"/>
    <arg value="${_param-three}"/>
</exec>
Run Code Online (Sandbox Code Playgroud)

这使得变量参数列表不可能.

如何解决这个问题呢?

Ale*_*man 13

这个怎么样:

 <arg line="whatever args you need"/>
Run Code Online (Sandbox Code Playgroud)