Apache Ant Condition Task

It is used to make conditional task, it sets property if the certain condition holds true.

If the condition holds true, the property value is set to true by default otherwise, the property is not set. We can set a value to something other than the default by specifying a new value to the value attribute.

We must specify exactly one condition and can also specify as nested elements.

Apache Ant Condition Attributes

AttributeDescriptionRequired
propertyProperty name which to be set.Yes
valueValue to set the property.No
elseThe value to set the property to if the condition evaluates to false.No

Apache Ant Condition Example

Set the property javamail.complete if both the JavaBeans Activation Framework and JavaMail are available in the classpath.





Latest Courses