property


Tag: property

Defines an ivy variable. since 1.3 The optional override attribute enables you to avoid overriding the previous value of the variable, which makes the definition behave like an ant property, which is particularly useful to define default values (values which are used only if they haven't been defined yet).

Attributes

AttributeDescriptionRequired
namethe name of the variable to define Yes
valuethe new value the variable must take Yes
overridetrue if the previous value (if any) of the variable should overriden, false otherwise No, defaults to true
ifsetthe variable will be set only if the provided 'ifset' variable is already set (Since 2.4)No
unlesssetthe variable will not be set unless the provided 'unlessset' variable is set (Since 2.4)No

Examples

<property name="myvar" value="myvalue"/>
Sets the variable myvar to the value myvalue.

<property name="myvar" value="myvalue" override="false"/>
Sets the variable myvar to the value myvalue only if myvar has not been set yet.

 <properties environment="env"/>
<property name="ivy.repos.server" value="${env.IVY_SERVER}" override="false" ifset="env.IVY_SERVER" />
<property name="ivy.repos.server" value="http://ivy:8081" override="false"/>
If the environment variable is set, it takes precedence over of default value.