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 Filesystems window and choose Properties.
  2. Click the ellipsis button for the Project Properties property. The Create Properties File wizard opens.
  3. Enter a unique name for the properties file or click Next to accept the default name. The IDE automatically appends the .ant.properties suffix to the file name.
  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 by right-clicking the target in the Filesystems window, choosing Properties, and clicking the ellipsis for the Target Properties property.

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

To change the properties file referenced by your Ant script:

  1. Right-click the Ant script node in the Filesystems window 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 Script Node
Executing a Target
Modifying a Properties File
Configuring Ant Settings


Legal Notices