About Us
Home
Contributors
License
Components
Sandbox
Jelly
Overview
FAQ
Getting Started
Tutorial
Detail
JellyDoc
Download
Tag Reference
All tags
ant:ant
ant:fileScanner
ant:setProperty
antlr:antlr
antlr:grammar
bean:bean
bean:beanProperty
bean:beandef
beanshell:script
betwixt:introspector
betwixt:parse
bsf:script
define:attribute
define:bean
define:classLoader
define:dynaBean
define:extend
define:invoke
define:invokeBody
define:jellyBean
define:script
define:super
define:tag
define:taglib
dynabean:dynabean
dynabean:dynaclass
dynabean:property
dynabean:set
email:email
fmt:bundle
fmt:formatDate
fmt:message
fmt:param
fmt:setBundle
fmt:setLocale
fmt:setTimeZone
fmt:timeZone
html:parse
http:body
http:delete
http:get
http:head
http:header
http:multipartPost
http:options
http:parameter
http:part
http:post
http:put
http:session
interaction:ask
jaxme:generator
jaxme:marshall
jaxme:unmarshall
jetty:deleteRequest
jetty:getRequest
jetty:httpContext
jetty:jellyResourceHandler
jetty:jettyHttpServer
jetty:notFoundHandler
jetty:postRequest
jetty:putRequest
jetty:realm
jetty:resourceHandler
jetty:responseBody
jetty:responseCode
jetty:responseHeader
jetty:securityHandler
jetty:socketListener
jface:action
jface:applicationWindow
jface:contributionItem
jface:doubleClickListener
jface:fieldEditor
jface:menuManager
jface:preferenceDialog
jface:preferencePage
jface:selectionChangedListener
jface:viewer
jface:wizardDialog
jface:wizardPage
jms:connection
jms:destination
jms:mapEntry
jms:mapMessage
jms:message
jms:objectMessage
jms:onMessage
jms:property
jms:receive
jms:send
jms:stopWatch
jms:subscribe
jms:textMessage
jmx:operation
jmx:register
jmx:server
jsl:applyTemplates
jsl:style
jsl:stylesheet
jsl:template
junit:assert
junit:assertEquals
junit:assertThrows
junit:case
junit:fail
junit:run
junit:suite
log:debug
log:error
log:fatal
log:info
log:trace
log:warn
ojb:broker
ojb:store
quartz:cronTrigger
quartz:job
quartz:waitForScheduler
regexp:contains
regexp:match
soap:invoke
soap:invokeRaw
sql:dateParam
sql:driver
sql:param
sql:query
sql:resultSet
sql:row
sql:setDataSource
sql:transaction
sql:update
swing:action
swing:borderAlign
swing:borderLayout
swing:buttonGroup
swing:component
swing:constraint
swing:dialog
swing:emptyBorder
swing:etchedBorder
swing:focusListener
swing:font
swing:gbc
swing:gridBagLayout
swing:keyListener
swing:tableLayout
swing:tableModel
swing:tableModelColumn
swing:td
swing:titledBorder
swing:tr
swing:windowListener
swt:GC
swt:color
swt:dialog
swt:font
swt:image
swt:layout
swt:layoutData
swt:menu
swt:onEvent
swt:swtHelper
swt:widget
threads:group
threads:interrupt
threads:join
threads:mutex
threads:notify
threads:sleep
threads:synchronize
threads:thread
threads:wait
threads:waitFor
util:available
util:file
util:loadText
util:properties
util:replace
util:sleep
util:sort
util:tokenize
validate:assertValid
validate:validate
validate:verifier
velocity:merge
xml:attribute
xml:comment
xml:copy
xml:copyOf
xml:docType
xml:element
xml:expr
xml:forEach
xml:if
xml:param
xml:parse
xml:set
xml:sort
xml:transform
xmlunit:actual
xmlunit:assertDocumentsEqual
xmlunit:expected
Ant
Antlr
Bean
BeanShell
Betwixt
BSF
Define
DynaBean
Email
Format
HTML
HTTP
Interaction
JaxMe
Jetty
JFace
JMS
JMX
JUnit
Log
OJB
Quartz
Regexp
SOAP
SQL
Swing
SWT
Threads
Utility
Validate
Velocity
XML
XMLUnit
Community
IRC
Powered By
To Do List
Features
JellyUnit
JellySwing
JellySWT
XML Pipeline
Core Tags
Tag Libraries
General Information
Charter
Volunteering
Contributing Patches
Releasing Components
Jakarta Community
Get Involved
Mailing Lists
Commons Resources (Unofficial)
Wiki
Japanese Translation
Korean Translation
Related
DB Commons
XML Commons

### Home Page

See http://jakarta.apache.org/commons/jelly/libs/ant/

### 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

Name | Description | Required
--- | --- | ---
name | The name of the attribute of the ant task to set | Yes
value | The value to give the attribute of the ant task | Yes.
default | The 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>