在groovy 1.7.2中使用antbuilder邮件任务的问题

时间:2010-05-19 08:19:57

标签: ant groovy email

我最近在groovy中使用antbuilder邮件任务时遇到了问题。它总是抛出以下异常:

  

[mail]发送电子邮件:null

     

[mail]无法发送电子邮件:0

     

Caught :: java.lang.ArrayIndexOutOfBoundsException:0

我认为问题恰好出现在新的1.7.2版本的发布上,但我无法确定。

以下是摘录:

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!')
}

知道如何让这个工作吗? 谢谢,Ingo

2 个答案:

答案 0 :(得分:1)

我发现问题是我的类路径中有GroovyWS。请参阅:http://jira.codehaus.org/browse/GMOD-55

答案 1 :(得分:0)

是的,你是绝对正确的。只需移除那个罐子即可。谢谢。但是因为我使用了groovyws lib,所以我必须使用普通的javax.mail代码...

相关问题