Description

This tag sets an attribute of an Ant task or datatype if the given value is not null. This is very useful in allowing attributes of ant tasks to be set conditionally without ugly if/then/else logic.

Attributes

NameDescriptionRequired
nameThe name of the attribute of the ant task to setYes
valueThe value to give the attribute of the ant taskYes.
defaultThe default value to give the attribute of the ant task, if the value provided is null.No

Nested Elements

None

Examples

This tag is always nested inside of another Ant task, target or datatype.

<j:jelly xmlns:j="jelly:core" xmlns:ant="jelly:ant">
  <ant:javac
    destdir="${maven.build.dest}"
    excludes="**/package.html"
    debug="${maven.compile.debug}"
    deprecation="${maven.compile.deprecation}"
    optimize="${maven.compile.optimize}">
  
    <ant:setProperty name="encoding" value="${maven.compile.encoding}" />
          
    <ant:setProperty name="executable" value="${maven.compile.executable}" />

  </ant:javac>
</j:jelly>