Java 如何复制ant运行后创建的文件

Java 如何复制ant运行后创建的文件,java,eclipse,ant,eclipse-plugin,Java,Eclipse,Ant,Eclipse Plugin,我的蚂蚁代码 <?xml version="1.0" encoding="UTF-8"?> <project default="plugin_export" name="build"> <target name="plugin_export"> <pde.exportPlugins destination="C:\" exportSource="false" exportType="directory" plugins="MyPlugin"

我的蚂蚁代码

<?xml version="1.0" encoding="UTF-8"?>
<project default="plugin_export" name="build">
  <target name="plugin_export">
    <pde.exportPlugins destination="C:\" exportSource="false" exportType="directory" plugins="MyPlugin" useJARFormat="true" allowbinarycycles="true" filename="MyPlugin.jar" qualifier="X" />
    <waitfor maxwait="15" maxwaitunit="minute">
      <copy todir="j:\eclipse-rcp-juno-SR1-win32\dropins\">
        <fileset dir="c:\plugins\">
          <include name="*" />
        </fileset>
      </copy>
    </waitfor>
  </target>
</project>

它不起作用,因为我

windows_build.xml:8:waitfor不支持嵌套的“copy”元素

exportPlugins部分由eclipse自动生成,它运行后台进程,用插件创建jar

我想将该插件复制到我使用的3个eclpse实例中,并将其放在dropins文件夹中。
如何做?

要在构建完成后完成工作,可以使用buildlistener。
Kev Jackson在他的演示文稿中实现了一个非常有用的exec listener=
(演示文稿中包含了源代码)。
对于每个生成结果(生成成功|生成失败),它提供一个taskcontainer 您可以将构建完成后应该运行的所有内容放入中:

<exec-listener onSuccess="true">
    <echo>Executing after BUILD SUCCESSFUL...</echo>
    <exec executable="..">
      <arg value="..."/>
    </exec>
    <mail ... />
   ..other tasks
  </exec-listener>
<exec-listener onSuccess="false">
    <echo>Executing after BUILD FAILED...</echo>
    <exec executable="..">
      <arg value="..."/>
    </exec>
    <mail ... />
   ..other tasks
  </exec-listener>

生成成功后正在执行。。。
…其他任务
生成后执行失败。。。
…其他任务

您的ant构建文件是否有保证在构建完成后运行的目标?如果是这样,你可以覆盖它。你可以把复制块移到waitFor之外吗。Waitfor在检查结果(如文件)时很有意义。嗯,它不能说目录复制什么时候完成。