eclipse build.xml一例

<?xml version="1.0"?>

<project name="StrutsTest" basedir="." default="compile">
    <!-- <property file="build.properties"/>-->
   
    <property name="tomcat.home" value="C:/Program Files/Apache Software Foundation/Tomcat 5.0"/>

    <property name="src.dir" value="src"/>
    <property name="web.dir" value="web"/>
    <property name="lib.dir" value="lib"/>
    <property name="page.dir" value="${web.dir}/pages"/>
    <property name="class.dir" value="${web.dir}/WEB-INF/classes"/>
    <property name="name" value="StrutsTest"/>

    <path id="master-classpath">
        <fileset dir="${lib.dir}">
            <include name="*.jar"/>
        </fileset>
        <!-- We need the servlet API classes:        -->
        <!--   for Tomcat 4.1 use servlet.jar        -->
        <!--   for Tomcat 5.0 use servlet-api.jar    -->
        <!--   for Other app server - check the docs -->
        <fileset dir="${tomcat.home}/common/lib">
            <include name="servlet*.jar"/>
        </fileset>
        <pathelement path="${class.dir}"/>
    </path>

    <target name="compile" description="Compile main source tree java files">
        <mkdir dir="${class.dir}"/>
        <javac destdir="${class.dir}" target="1.3" debug="true"
               deprecation="false" optimize="false" failοnerrοr="true">
            <src path="${src.dir}"/>
            <classpath refid="master-classpath"/>
        </javac>
    </target>
   
    <target name="deploy" depends="compile" description="Deploy application">
     <echo message="Deploy all file in the project to tomcat."/>
        <copy todir="${tomcat.home}/webapps/${name}" preservelastmodified="true">
            <fileset dir="${web.dir}">
                <include name="WEB-INF/**"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}" preservelastmodified="true">
            <fileset dir="${page.dir}">
                <include name="**/**"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}/WEB-INF/lib" preservelastmodified="true">
            <fileset dir="${lib.dir}">
                <include name="*.jar"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}/images" preservelastmodified="true">
            <fileset dir="${web.dir}/images">
                <include name="**/**"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}/scripts" preservelastmodified="true">
            <fileset dir="${web.dir}/scripts">
                <include name="**/**"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}/styles" preservelastmodified="true">
            <fileset dir="${web.dir}/styles">
                <include name="**/**"/>
            </fileset>
        </copy>
    </target>

    <target name="deploy-web" description="deploy only web to servlet container's deploy directory">
     <echo message="Deploy all static file to tomcat."/>
        <copy todir="${tomcat.home}/webapps/${name}">
            <fileset dir="${page.dir}">
                <include name="**/**"/>
            </fileset>
        </copy>
        <copy todir="${tomcat.home}/webapps/${name}">
            <fileset dir="${web.dir}">
                <include name="WEB-INF/classes/**"/>
            </fileset>
        </copy>
    </target>

    <target name="deploy-classes" description="deploy only web to servlet container's deploy directory">
     <echo message="Deploy classes to tomcat."/>
     <copy todir="${tomcat.home}/webapps/${name}/WEB-INF" preservelastmodified="true">
            <fileset dir="${web.dir}">
                <include name="WEB-INF/classes/**"/>
            </fileset>
        </copy>
    </target>
 
 <target name="undeploy" description="undeploy war file to servlet container's deployment dir">
        <echo message="Undeploying webapp from Tomcat"/>
        <delete dir="${tomcat.home}/webapps/${name}"/>
 </target>
 
 <property name="class.name" value="com.wxt.reports.JasperApp" />
 <property name="file.name" value="FirstJasper" />
 <property name="classes.dir" value="${class.dir}" />
 <property name="lib.dir" value="${web.dir}/WEB-INF/lib" />
 <property name="fonts.dir" value="fonts" />
 
 <path id="classpath">
  <pathelement location="./"/>
  <pathelement location="${classes.dir}" />
  <pathelement location="${fonts.dir}" />
  <fileset dir="${lib.dir}">
   <include name="**/*.jar"/>
  </fileset>
 </path>

 <!--
  Deletes all the generated files.
 -->
 <target name="clean">
  <delete dir="${classes.dir}" />
 </target>
   
   
   
</project>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值