What's the difference between @{property}
and ${property}
in accessing Ant properties?
Didn't see any obvious note about it in the Ant manual.
Properties are key-value pairs where each value is associated to a key. The property is used to set value which can be accessed anywhere in the buildfile. Once a property is set, it cannot be changed. Apache Ant provides <property> tag which can be used to set property.
Ant properties files let you move properties out of your build. xml file. You create . properties file for all the properties that are defined outside the build file.
The home directory for Ant library files - typically ANT_HOME/lib folder. Ant also makes the system properties (Example: file. separator) available to the build file. In addition to the above, the user can define additional properties using the property element.
${property}
is the normal way to access properties. @{property}
is used inside macro definitions to access arguments passed to this macro. See the Ant manual on macrodef.
${property}
is used to reference Properties.
@{attribute}
is used to reference Attributes in <macrodef>
Tasks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With