Setting Properties in an Ant Properties File

See Also 

You can set properties for your Ant scripts by entering them directly into the Ant script or by storing them in a separate Ant properties (ant.properties) file.

To set properties in a separate Ant properties file:

  1. Right-click the Ant script node in the Explorer and choose Properties.
  2. Click the ellipsis button in Project Properties. The Create Properties File wizard opens.
  3. Change the name for the properties file if necessary, or click Next to accept the default name. The IDE automatically appends the file name with the .ant.properties suffix.
  4. Type your properties in the text area. Write properties using the same syntax as regular properties files (key=value) without quotation marks. Click Finish.

    The properties file (properties file icon) is created in the same directory as your Ant script and a <property file="filename"> tag is added to your Ant script.

tip You can also set properties for individual targets using the Target Properties property in the target's property sheet.

To edit the contents of a properties file, do either of the following:

tip You can also edit a properties file from the Ant script's property sheet. Open the Ant script's property sheet and click the ellipsis in Project Properties.

To change the properties file referenced by your Ant script:

  1. Right-click the script or target's node in the Explorer and choose Properties.
  2. Select a different properties file from the Switch Properties File combo box. This combo box lists all of the .ant.properties files in the present directory.
tip In addition to your user-defined properties, the IDE also includes a set of global properties that are passed to Ant each time you run an Ant script. To view these properties, choose Tools and choosing Options and expand the Building node. Then select Ant Properties and click the ellipsis button in the Properties setting.
See Also

Ant Project Files
Executing a Target
Modifying a Properties File
Configuring Ant Settings


Legal Notices