Administer > Deploy > Overview: WebSphere Commerce Build and Deployment tool > Customize the Build and Deployment tool > Custom Ant tasks


ValidateProperty task

Validates the value of a property on whether it is set, whether the value is empty, or against a list of possible values, and fails the Ant build when validation fails.


Parameters

Attribute Description Required
property The name of the property to validate. Yes
nonEmpty Whether the property should be non-empty No; Defaults to false
trim Whether to trim the property before validation No; Defaults to false


Nested Elements:


ValidValue

Specifies a valid value of the property.

Attribute Description Required
value A valid string value of the property Exactly one of the two
regex A regular expression to match the property for validity


Examples

The following example validates that the property source.dir is set:

<validateProperty property="source.dir" />

The following example validates that the property source.dir is set and is non-empty without leading and trailing spaces.

<validateProperty property="source.dir" nonEmpty="true" trim="true" />

The following example validates that the property color is set, and is one of: red, green, light blue, or dark blue:

<validateProperty property="color"> 
    <validValue value="red" /> 
    <validValue value="green" /> 
    <validValue regex="(light|dark) blue" /> 
</validateProperty> 


Related concepts

Overview: WebSphere Commerce Build and Deployment tool

Related reference

Custom Ant tasks


+

Search Tips   |   Advanced Search