Apache Ant Filter Task

The filter tasks are token filters which are used by all tasks which uses copy task. This task uses @ as a token separator.

Apache Ant Filter Task Attributes

AttributeDescriptionRequired
tokenSet a token string without the separator chars @.Yes
valuethe string that should be put to replace the token when the file is copied.
filtersfileThe file from which the filters must be read.

Apache Ant Filter Task Example

Copy all the files from the src.dir directory into the dest.dir directory by filtering all the occurrences of the string @year@ with 2009.

// build.xml

Read property file

The below example will read all the properties from property file.





Latest Courses