Name

property

Synopsis

Sets properties in the project. Properties specified by users always take precedence over properties defined by this task. The same is true for properties defined by parent projects that invoke this project using the ant task.

Attributes

classpath (1.3, 1.4, Path, N)

The classpath to use when looking up a resource.

classpathref (1.3, 1.4, Reference, N)

A reference to a classpath defined elsewhere in the buildfile.

environment (1.3, 1.4, String, *)

A prefix used for retrieving environment variables. We use this in the upcoming example to retrieve the value of TOMCAT_HOME. This was also covered in Chapter 4 under “Environment DataType.”

file (all, File, *)

The name of a properties file. This defines a set of properties (name-value pairs) according to the contents of the properties file.

location (all, File, *)

Sets the property value to an absolute filename. If this attribute contains an absolute path, any "/" and "\" characters are converted to current system conventions. If the path is relative to the project, it is expanded to an absolute path.

name (all, String, N)

The name of the property to set.

refid (all, Reference, *)

A reference to a path or property defined elsewhere in the project.

resource (all, String, *)

The Java resource name of a properties file. Uses a ClassLoader to load the properties file.

value (all, String, *)

An explicit value for the property.

When name is specified, one of value, location, or refid is required. Otherwise, one of resource, file

Get Ant: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.