Ant > Ant Properties File
|
Ant Properties File
You can also group all the property values in a separate properties file and include it in the ant build file. Here the build.properties file contains all the property values. Remember the property value is immutable, so if you set a property value in the properties file you cannot change it in the build file. This give more control over the build process.
你可以集中所有的属性值到一个单独的属性文件中,用ant构建文件(build.xml)包含进来.这里的build.properties文件包含所有属性的值.记住属性的值是不可变得.所以如果你在属性文件中设定了值,那么你就不能在构建文件中更改它了.
The build.properties file.
web.lib.dir=${web.dir}/WEB-INF/lib
build.classes.dir=build/classes
dist.dir=dist
project.name=AntExample3
Use the property task to include the properties file in the Ant build file.
用property task将这个属性文件包含到Ant构建文件中.
<property file="build.properties" />
Here is the complete build file for your reference.
这里是是完整的构建文件(build.xml)供您参考.
<?xml version="1.0" ?>
<project name="AntExample3" default="war">
<property file="build.properties" />
<path id="compile.classpath">
<fileset dir="${web.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="init" depends="clean">
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}" />
</target>
<target name="compile" depends="init" >
<javac destdir="${build.classes.dir}" debug="true" srcdir="src">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="war" depends="compile">
<war destfile="${dist.dir}/${project.name}.war" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}"/>
<lib dir="${web.lib.dir}"/>
<classes dir="${build.classes.dir}"/>
</war>
</target>
<target name="clean">
<delete dir="${dist.dir}" />
<delete dir="${build.classes.dir}" />
</target>
</project>
You can download the build file here.
|
分享到:
相关推荐
Imagine that you are working ...and hassle you are experiencing, OK, enough of the rhetoric, this tool exists, it is called ANT. For a nice definition of what Ant is, see http://jakarta.apache.org/ant/.
a simple ant tutorial. enjoy...
学习javacc的好东东! JavaCC Tutorial Description of the JavaCC Grammar File
Tutorial
ANSYS Fluent Tutorial Guide 19.2 教程 官方案例 tutorial 典例 2积分
ANSYS 2021R2 Fuent_Tutorial_Package.zip,包括FLUENT模块所有官方案例三维示例网格文件,还有包括帮助文档PDF文件Ansys_Fluent_Tutorial_Guide_2021_R2.pdf,学习FLUENT各个官方案例的仿真步骤设置过程,依照各个...
OpenGL ES Tutorial for Android – Part I – Setting up the view OpenGL ES Tutorial for Android – Part II – Building a polygon OpenGL ES Tutorial for Android – Part III – Transformations OpenGL ES ...
FLUENT 2020R2 tutorial guide PDF及案例源文件 1.What’s In This Manual The ANSYS Fluent Tutorial Guide contains a number of tutorials that teach you how to use ANSYS Flu- ent to solve different types ...
spring tutorial 教程
Sun权威教程--《J2EE Tutorial中文版》 作者:Stephanie Bodoff,Dale Green,Kim Haase,Eric Jendrock,Monica Pawlan,Beth Stearns 翻译参与人员:sharetop,worldheart,zhaoy,bruce等 出版商:铁道出版社...
operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_...
TUTORIAL
tutorial代码
gtk+ 2.0 tutorial.pdf gtk+ 2.0 tutorial.pdf gtk+ 2.0 tutorial.pdf
java tutorialjava tutorial.chm
opencv tutorial code
J2EE tutorial 中文版