例如: 

<target name="callProjectB">
  <echo message="In projectA calling projectB"/>         
    <ant antfile="subfile/projectB.xml" /> 
</target>

说明:项目A通过ant命令执行项目B

属性:

(1) antfile : 指定要执行的构建文件名称,可以包含路径信息。

(2) dir : 指定构建文件所在的目录,相当于指定了要执行的构建文件的basedir属性,如果dir属性没有设置,会以当前构建文件的根目录作为ant任务的根目录。

(3) Target:指定要执行的构建文件要执行的target。例如

<project name="porjectA" default="callProjectB">   

     <target name="callProjectB">        

          <echo message="In projectA calling projectB"/>                

           <ant antfile="subfile/projectB.xml" target=" target2"/>    

     </target>

</project>
View Code

相关文章:

  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-07-26
  • 2021-11-06
猜你喜欢
  • 2021-10-28
  • 2021-09-25
  • 2021-09-01
  • 2021-05-20
  • 2021-06-11
  • 2022-02-02
  • 2021-10-05
相关资源
相似解决方案