Since Ant 1.7
Load a text resource into a single property. Unless an encoding is specified, the encoding of the current locale is used. Resources to load are specified as nested resource elements or single element resource collections.
Attribute | Description | Required |
property | property to save to | Yes |
encoding | encoding to use when loading the resource | No |
failonerror | Whether to halt the build on failure | No, default "true" |
quiet | Do not display a diagnostic message (unless Ant has been
invoked with the -verbose or -debug
switches) or modify the exit status to reflect an error. Setting this to
"true" implies setting failonerror to "false".
|
No, default "false" |
The LoadResource task supports nested FilterChains.
<loadresource property="homepage"> <url url="http://ant.apache.org/index.html"/> </loadresource>Load the entry point of Ant's homepage into property "homepage"; an <echo> can print this.
For more examples see the loadfile task.