Issue with using the antbuilder mail task in groovy 1.7.2
I recently have a problem using the antbuilder mail task in groovy. It always throws the following exception:
[mail] Sending email: null
[mail] Failed to send email: 0
Caught: : java.lang.ArrayIndexOutOfBoundsException: 0
I think the problem just occurred with the r开发者_如何学Goelease of the new 1.7.2 version, but I cannot be sure of it.
Here is the snippet:
ant = new AntBuilder()
ant.mail(mailhost:'localhost',mailport:'25',subject:'Hello Ant World',messagemimetype:'text/html') {
from(address:'changed@to.protect.the.innocent')
to(address:'changed@to.protect.the.innocent')
message('Hello ant world!')
}
Any idea how to get this working? Thanks, Ingo
I found the problem was that i had GroovyWS in my classpath. See: http://jira.codehaus.org/browse/GMOD-55
Yes, you are absolutely right. By just removing that jar it works. Thanks. But since I use the groovyws lib I had to work it out with plain javax.mail code...
精彩评论