Java 从ant调用多个ant目标

Java 从ant调用多个ant目标,java,ant,build,Java,Ant,Build,在我的主构建文件中,我想在多个其他构建文件中调用相同的目标。我目前的解决方案是分别调用它们,如下所示: <ant antfile="${lib_src_dir}/mylib1/build.xml" target="build" inheritAll="false"/> <ant antfile="${lib_src_dir}/mylib2/build.xml" target="build" inheritAll="false"/> 你想要这个任务。以下是我使用这个任务得

在我的主构建文件中,我想在多个其他构建文件中调用相同的目标。我目前的解决方案是分别调用它们,如下所示:

<ant antfile="${lib_src_dir}/mylib1/build.xml" target="build" inheritAll="false"/>
<ant antfile="${lib_src_dir}/mylib2/build.xml" target="build" inheritAll="false"/>

你想要这个任务。

以下是我使用这个任务得到的结果:



我刚刚注意到subant任务。那可能是我想要的。哈,我刚刚注意到你上面的评论。
<ant antfile="${lib_src_dir}/*/build.xml" target="build" inheritAll="false"/>
<subant target="clean">
    <fileset dir="${lib_src_dir}" includes="*/build.xml" />
</subant>