posts - 48, comments - 13, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          用ant bulid時顯示javac的文件列表

          Posted on 2009-01-05 10:03 董銳 閱讀(698) 評論(0)  編輯  收藏
          在Eclipse下打開Window-preference,點擊ant,鉤中 create problem markers from "javac" results

          在bulid.xml中配置紅色屬性就行了。

          <project name="YGKH" default="help" basedir="." >

           <property name="build.dir" value="WEB-INF/classes"/>
           <property name="lib.dir" value="WEB-INF/lib"/>
           <property name="src.dir" value="src"/>
           
           <target name="help">
            <echo>
            This script requires Ant 1.5 or higher

            usage:
               ant -help  display ant help screen
               ant help   display this message
               ant clean  delete the built directory
               ant war   war
            </echo>
           </target>
           <path id="master-classpath">
            <fileset dir="${lib.dir}">
              <include name="*.jar"/>
            </fileset>
           </path>
           <target name="clean">
            <delete file="${war.file}" quiet="true"/>
            <delete dir="${build.dir}"/>
           </target>


           <target name="build" description="Compile main source tree java files into class files, generate jar files">

             <mkdir dir="${build.dir}"/>

             <javac destdir="${build.dir}"  listfiles="true"
              debug="true" deprecation="false" optimize="false" failonerror="true">
              <src path="${src.dir}"/>
              <classpath refid="master-classpath"/>
             </javac>
             <copy todir="${build.dir}" preservelastmodified="true">
               <fileset dir="${src.dir}">
                <include name="**/*.xml"/>
               </fileset>
             </copy>
           </target>

           <target name="war" depends="build">
            <war warfile="YGKH.war" webxml="WEB-INF/web.xml">
             <fileset dir="../YGKH">
              <include name="images/**"/>
              <include name="WEB-INF/**"/>
              <include name="css/**"/>
              <include name="js/**"/>
              <include name="*.html"/>
             </fileset>
             
            </war>
           </target>
           <target name="all" depends="clean,build,war" description="Clean,build,war"/>
          </project>


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 宣武区| 博爱县| 丹东市| 德庆县| 湘潭市| 涿州市| 商水县| 合江县| 沐川县| 拉萨市| 榆中县| 洱源县| 新宁县| 德清县| 郸城县| 梁山县| 定远县| 乌鲁木齐县| 临沧市| 丰原市| 九龙坡区| 扎囊县| 铁岭市| 陆良县| 宿州市| 岑巩县| 中牟县| 青河县| 太康县| 台江县| 苏尼特右旗| 大渡口区| 长治市| 阿拉善右旗| 平和县| 临澧县| 全南县| 开封县| 黄山市| 洪洞县| 东辽县|