ant 生成报告时报错,Errors while applying transformations: Fatal error during transformation

在使用ant 编译,生成报告时,发现一直报这样一个错,

[junitreport] Loading stylesheet jar:file:/E:/eclipse/plugins/org.apache.ant_1.8.4.v201303080030/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! 非 static Java 函数 'replace' 的第一个参数不是有效的对象引用。
[junitreport] : Error! 无法将数据类型 'void' 转换为 'reference'。
[junitreport] : Fatal Error! 无法编译样式表
[junitreport] Failed to process D:\workspace_ep\publisher\dist\testreport\TESTS-TestSuites.xml

BUILD FAILED
D:\workspace_ep\publisher\build.xml:128: The following error occurred while executing this line:
D:\workspace_ep\publisher\build.xml:136: Errors while applying transformations: Fatal error during transformation

使用的是 

Eclipse Kepler +jdk1.7

发现在使用ant的时候,eclipse 自带的是ant1.8.4版本,但是这个版本和jdk 1.7有冲突,

还好,替换上新版的ant之后,问题就解决了。

官网下载ant1.9.4, 调整eclipse 内的 jar时,我们可以单独只取lib下的jar文件,

调整eclipse下的ant编译jar。window-Preferences-Ant-Runtime-Ant Home Entries(Default),

删除其中的1.8.4.jar (我这里是全部都Remove了),然后add Extranaljar(不必要将ant导入到项目中),apply保存后,在运行ant,
ok,已经不报错了。

 

转载于:https://www.cnblogs.com/junyi0120/p/5519963.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值