zoukankan      html  css  js  c++  java
  • Ant项目打包脚本

    <!-- path of the web source files -->
    <property name="webapp.path" value="." />

    <!-- build output name -->
    <property name="output_war" value="myapp.war" />

    <!-- paths to the Tomcat JSP compiler -->
    <property name="catalina.home" value="C:\Programmer\Tomcat 5.5" />

    <target name="make_war" depends="compile">
    <description>Harvest the compiled files and html files into a WAR file ready for deployment</description>
    <war destfile="${output_war}" webxml="${webapp.path}/WEB-INF/web.xml">
    <classes dir="${webapp.path}/WEB-INF/classes"/>
    <zipfileset dir="${webapp.path}/graphics/images/" prefix="images"/>
    </war>
    </target>


    <target name="compile" depends="jsp_compile">
    <description>
    Compile the generated servlets and change web.xml into mapping the servlets to the corresponding .jsp urls.
    </description>

    <mkdir dir="${webapp.path}/WEB-INF/classes"/>
    <mkdir dir="${webapp.path}/WEB-INF/lib"/>

    <javac destdir="${webapp.path}/WEB-INF/classes" srcdir="${webapp.path}/WEB-INF/src" >
    <classpath>
    <pathelement location="${webapp.path}/WEB-INF/classes" />
    <fileset dir="${webapp.path}/WEB-INF/lib"> <include name="*.jar" /></fileset>

    <pathelement location="${catalina.home}/common/classes" />
    <fileset dir="${catalina.home}/common/lib"> <include name="*.jar" /></fileset>

    <pathelement location="${catalina.home}/shared/classes" />
    <fileset dir="${catalina.home}/shared/lib"> <include name="*.jar" /></fileset>

    <fileset dir="${catalina.home}/bin"> <include name="*.jar" /></fileset>
    </classpath>
    <include name="**" />
    <exclude name="tags/**" />
    </javac>
    </target>


    <target name="jsp_compile" depends="clean_jspcompile">
    <description>Take all .jsp pages and convert them into servlets using the Tomcat jsp compiler</description>
    <taskdef classname="org.apache.jasper.JspC" name="jasper2">
    <classpath id="jspc.classpath">
    <fileset dir="${catalina.home}/bin"><include name="*.jar"/> </fileset>
    <fileset dir="${catalina.home}/server/lib"> <include name="*.jar"/> </fileset>
    <fileset dir="${catalina.home}/common/lib"> <include name="*.jar"/> </fileset>
    </classpath>
    </taskdef>

    <jasper2 uriroot="${webapp.path}"
    webXmlFragment
    ="${webapp.path}/WEB-INF/generated_web.xml"
    addWebXmlMappings
    ="true"
    outputDir
    ="${webapp.path}/WEB-INF/src/" />

    <!-- path to the compiler generated web.xml -->
    <!-- automatically merge the "generated_web.xml" into "web.xml" -->
    <!-- path to the output of the compilation -->
    </target>

    <target name="clean_jspcompile">
    <description>clear the generated source files</description>
    <delete dir="${webapp.path}/WEB-INF/src"/>
    </target>
  • 相关阅读:
    ALOS卫星概况
    如何安装和配置jdk6u18windowsi586.exe
    请问是否可以直接发布切片好的服务 arcgis serever
    eclipse and myeclipse
    GISer还有机会屌丝逆袭吗?
    ArcGIS中加载百度地图
    细说委托
    白话地图投影之Proj.4地图投影库简介
    让OpenLayers添加百度地图(未完版)
    白话地图投影之墨卡托投影
  • 原文地址:https://www.cnblogs.com/BigIdiot/p/2349411.html
Copyright © 2011-2022 走看看