ant学习笔记(七)

因为某些需求,今天尝试着使用ant中的<mail>task发送邮件,提醒相关人员build成功完成。脚本很简单,摘录ant中的example如下:

<mail mailhost="somehost@xyz.com" mailport="25" subject="Build successful"  charset="utf-8">
  <from address="me@myist.com"/>
  <to address="all@xyz.com"/>
  <message>some international text</message>
</mail>

上午运行的时候没有什么问题,但是下午传到ClareCase上面以后就不行了,抛出如下异常:

[mail] Failed to initialise MIME mail: javax.mail.Address 

Google了一下,发现只有一个人和喵喵有同样的问题,似乎是因为Library Dependencies的问题,然后look up了一下Ant User Manual,无语了——

Note: This task may depend on external libraries that are not included in the Ant distribution. See Library Dependencies for more information.

喵喵要什么时候才能仔细一点呢……

找到了问题,解决起来就简单了n_n

mail.jarMail task with Mime encoding, and the MimeMail taskhttp://java.sun.com/products/javamail/

activation.jarMail task with Mime encoding, and the MimeMail taskhttp://java.sun.com/products/javabeans/glasgow/jaf.html

在上述网址中下载第三方API,把其中的mail.jar和activation.jar添加到ANT_HOME/lib下面,再运行ant脚本,就一切OK了~~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值