The first time I ran into this, took some time to figure out. Maybe because I haven't got used to this dynamic language.
def sendMail(mailhost, port, from, to) {
ant.mail(mailhost:"${mailhostname}", mailport:"${port}", subject:'Test Email') {
from( address:"${from}" )
to( address:"${to}" )
message(msg)
}
}
Code above will throw this exception, because groovy will use input parameter "from" and "to" to evaluate from, to function ant.mail closure.
Change to a different name.
No comments:
Post a Comment