Eclipse build. xml example

Source: Internet
Author: User
Tags echo message xml example

<? 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" failonerror = "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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.