分享

ant脚本打包

 onlyyiyi 2014-09-26

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.) by fhj (zte) -->
<project basedir="." default="buildshop" name="Mboss">
    <!-- wssmall build -->
    <property name="project.dir" value="E:\hbwt\CtWeb_he"/>
    <property name="war.dir" value="E:\hbwt\war"/>
   
    <!-- 这里是jdklib lib的目录, 换成本机的目录 -->
    <property name="jdklib" value="C:\Program Files\Java\jdk1.6.0_26\lib"/>
   <property name="subject" value="mmarket deploy" />

   
    <path id="project.class.path">
        <fileset dir="${project.dir}/WebRoot/WEB-INF/lib">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${project.dir}/WebRoot/WEB-INF/classes">
            <include name="**/*.*"/>
        </fileset>
         <fileset dir="${jdklib}">
  <include name="*.jar"/>
 </fileset>
    </path>
   
    <target name="init">
        <delete failonerror="false" includeEmptyDirs="true">
            <fileset dir="${project.dir}/WebRoot/WEB-INF/classes"/>
 </delete>
    </target>
    <target name="buildshop" depends="init">
        <mkdir dir="${project.dir}/WebRoot/WEB-INF/classes"/>
      
        <javac srcdir="${project.dir}/src" destdir="${project.dir}/WebRoot/WEB-INF/classes" memoryInitialSize="128m" memoryMaximumSize="512m" deprecation="true" encoding="GBK" fork="true" failonerror="true" debug="true" includeantruntime="on">
            <classpath refid="project.class.path"/>
        </javac>
        <!--copy config file to classes-->
        <copy todir="${project.dir}/WebRoot/WEB-INF/classes">
            <fileset dir="${project.dir}/src">
                <include name="**/*.*"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>

        <delete file="${project.dir}/WebRoot/WEB-INF/lib/j2ee.jar"/>

        <war compress="false" destfile="${war.dir}/CtWeb.war" webxml="${project.dir}/WebRoot/WEB-INF/web.xml">
            <zipfileset dir="${project.dir}/WebRoot"/>
            <include name="**/*.*"/>  
        </war>

    </target>
    <!-- all target -->
    <target name="all" depends="buildshop">
    </target>
</project>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多