-1

我已经制作了 jar 战争 EAR

使用 ant 和 Hudson 并将所有文件存储在某个临时文件夹中

现在我想使用 Apache ANT 将所有 war 和 ear 文件复制到 jboss jboss/default/deploy 文件夹

我怎样才能做到这一点??

以下是我的主构建文件,它调用所有其他 build.xml 文件并制作 jar war ear 文件

但是在制作完所有文件之后,这不会将所有文件复制到 jboss/default/deploy 文件夹

<copy todir="${jbossdeploy.dir}" overwrite="yes">
        <fileset dir="${class.dir}/ear" includes="MessageBoardEAR.ear"/>


    </copy>

<project name="master" >

    <property name="class.dir" location="../Source/buildwork" />
    <property name="ecpsproperties.dir" location="D:\ecpsproperties\jars\platform" />
    <property name="jbossdeploy.dir" location="D:\jboss-6.1.0.Final\server\default\deploy" />

    <target name="clean">
        <delete dir="${class.dir}" />

    </target>

    <target name="makedir">
        <mkdir dir="${class.dir}" />
        <mkdir dir="${class.dir}/jar" />
        <mkdir dir="${class.dir}/ear" />
        <mkdir dir="${class.dir}/war" />
    </target>

<filelist id="projects" dir=".">
        <file name="../Source/ValueObjects/build.xml"/>
        <file name="../Source/ECPSValueObjects/build.xml"/>
        <file name="../Source/ECPSUtils/build.xml"/>
        <file name="../Source/CommonExceptions/build.xml"/>
         <file name="../Source/ECPSExceptions/build.xml"/>
         <file name="../Source/ECPSCommon/build.xml"/>
         <file name="../Source/BaseDAO/build.xml"/>
         <file name="../Source/PageManagerValueObjects/build.xml"/>
         <file name="../Source/PageManagerDAO/build.xml"/>
         <file name="../Source/ECPSDAO/build.xml"/>
         <file name="../Source/PageManagerEJBClient/build.xml"/>
         <file name="../Source/PartyEJBClient/build.xml"/>
          <file name="../Source/ReportsEJBClient/build.xml"/>
         <file name="../Source/StagingEJBClient/build.xml"/>
          <file name="../Source/MessageBoardEJBClient/build.xml"/>
         <file name="../Source/PageManagerFacade/build.xml"/>
          <file name="../Source/PartyFacade/build.xml"/>
         <file name="../Source/ReportsFacade/build.xml"/>
          <file name="../Source/StagingFacade/build.xml"/>
         <file name="../Source/MessageBoardFacade/build.xml"/>

          <file name="../Source/MessageBoardEJB/build.xml"/>
         <file name="../Source/MessageBoardEAR/build.xml"/>
         <file name="../Source/PageManagerEJB/build.xml"/>
          <file name="../Source/PageManagerEAR/build.xml"/>

           <file name="../Source/PartyEJB/build.xml"/>
         <file name="../Source/PartyEAR/build.xml"/>

         <file name="../Source/ReportsEJB/build.xml"/>
          <file name="../Source/ReportsEAR/build.xml"/>

          <file name="../Source/StagingEJB/build.xml"/>
         <file name="../Source/StagingEAR/build.xml"/>

          <file name="../Source/Admin/build.xml"/>
         <file name="../Source/eCPSClient/build.xml"/>
          <file name="../Source/MessageBoardServices/build.xml"/>
           <file name="../Source/OAuth/build.xml"/>
            <file name="../Source/PageManagerRest/build.xml"/>
             <file name="../Source/PartyServices/build.xml"/>
             <file name="../Source/ReportsServices/build.xml"/>
          <file name="../Source/StagingServices/build.xml"/>


 </filelist>



    <copy todir="${jbossdeploy.dir}" overwrite="yes">
        <fileset dir="${class.dir}/ear" includes="MessageBoardEAR.ear"/>


    </copy>




 <target name="main" depends="clean, makedir">
    <subant>

      <filelist refid="projects" />

    </subant>

 </target>
</project>
4

2 回答 2

0

使用复制任务,例如

<copy file="myfile.txt" todir="../some/other/dir"/>
于 2012-04-19T09:23:46.400 回答
0

这应该可以工作,因为我在 main 下添加了复制任务:

<project name="master" >

<property name="class.dir" location="../Source/buildwork" />
<property name="ecpsproperties.dir" location="D:\ecpsproperties\jars\platform" />
<property name="jbossdeploy.dir" location="D:\jboss-6.1.0.Final\server\default\deploy" />

<target name="clean">
<delete dir="${class.dir}" />

</target>

<target name="makedir">
<mkdir dir="${class.dir}" />
<mkdir dir="${class.dir}/jar" />
<mkdir dir="${class.dir}/ear" />
<mkdir dir="${class.dir}/war" />
</target>

<filelist id="projects" dir=".">
<file name="../Source/ValueObjects/build.xml"/>
<file name="../Source/ECPSValueObjects/build.xml"/>
<file name="../Source/ECPSUtils/build.xml"/>
<file name="../Source/CommonExceptions/build.xml"/>
<file name="../Source/ECPSExceptions/build.xml"/>
<file name="../Source/ECPSCommon/build.xml"/>
<file name="../Source/BaseDAO/build.xml"/>
<file name="../Source/PageManagerValueObjects/build.xml"/>
<file name="../Source/PageManagerDAO/build.xml"/>
<file name="../Source/ECPSDAO/build.xml"/>
<file name="../Source/PageManagerEJBClient/build.xml"/>
<file name="../Source/PartyEJBClient/build.xml"/>
<file name="../Source/ReportsEJBClient/build.xml"/>
<file name="../Source/StagingEJBClient/build.xml"/>
<file name="../Source/MessageBoardEJBClient/build.xml"/>
<file name="../Source/PageManagerFacade/build.xml"/>
<file name="../Source/PartyFacade/build.xml"/>
<file name="../Source/ReportsFacade/build.xml"/>
<file name="../Source/StagingFacade/build.xml"/>
<file name="../Source/MessageBoardFacade/build.xml"/>

<file name="../Source/MessageBoardEJB/build.xml"/>
<file name="../Source/MessageBoardEAR/build.xml"/>
<file name="../Source/PageManagerEJB/build.xml"/>
<file name="../Source/PageManagerEAR/build.xml"/>

<file name="../Source/PartyEJB/build.xml"/>
<file name="../Source/PartyEAR/build.xml"/>

<file name="../Source/ReportsEJB/build.xml"/>
<file name="../Source/ReportsEAR/build.xml"/>

<file name="../Source/StagingEJB/build.xml"/>
<file name="../Source/StagingEAR/build.xml"/>

<file name="../Source/Admin/build.xml"/>
<file name="../Source/eCPSClient/build.xml"/>
<file name="../Source/MessageBoardServices/build.xml"/>
<file name="../Source/OAuth/build.xml"/>
<file name="../Source/PageManagerRest/build.xml"/>
<file name="../Source/PartyServices/build.xml"/>
<file name="../Source/ReportsServices/build.xml"/>
<file name="../Source/StagingServices/build.xml"/>


</filelist>








<target name="main" depends="clean, makedir">
<subant>

<filelist refid="projects" />

</subant>

<copy todir="${jbossdeploy.dir}" overwrite="yes">
<fileset dir="${class.dir}/ear" includes="MessageBoardEAR.ear"/>


</copy>
</target>
</project>
于 2012-04-19T10:08:43.030 回答