Tua*_*uan 21 java eclipse ant junit
我希望有一些人已经看到并解决了我现在使用的蚂蚁脚本问题.我正在使用ant脚本在eclipse中编译我的java代码,但是eclipse不断给我这些错误
[junitreport] Processing E:\workspace\DataOrchestrationDevelopment\DataOrchestration\Logs\jsreports\junit\html\TESTS-TestSuites.xml to C:\Users\u0160235\AppData\Local\Temp\null1503375679
[junitreport] Loading stylesheet jar:file:/E:/software/apache/apache-ant-1.8.2/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! The first argument to the non-static Java function 'replace' is not a valid object reference.
[junitreport] : Error! Cannot convert data-type 'void' to 'reference'.
[junitreport] : Fatal Error! Could not compile stylesheet
[junitreport] Failed to process E:\workspace\DataOrchestrationDevelopment\DataOrchestration\Logs\jsreports\junit\html\TESTS-TestSuites.xml
BUILD FAILED
E:\workspace\DataOrchestrationDevelopment\DataOrchestration\ant\developerbuild.xml:124: The following error occurred while executing this line:
E:\workspace\DataOrchestrationDevelopment\DataOrchestration\ant\QunitAntScript.xml:20: Errors while applying transformations: Fatal error during transformation
Run Code Online (Sandbox Code Playgroud)
我的环境设置:
有一点需要提一下,如果我使用相同的蚂蚁脚本在eclipse之外编译我的代码,一切正常,但它在eclipse中不起作用.我试图谷歌上面的样式表上面的错误,但这对我没有多大帮助.我的猜测是某种方式,在eclipse中使用不同版本的junit,但我可能错了.
Ste*_*ell 17
我使用以下环境在Eclipse中遇到了相同的样式表问题:
使用JDK 1.6.0_31时,我的构建成功,因此看起来样式表问题是随Java 6版本32发布的Ant或Java错误.我在Apache的Bugzilla系统中找不到任何报告.如果它对某人有帮助,这些是构建32中包含的错误修复:http://www.oracle.com/technetwork/java/javase/2col/6u32bugfixes-1579554.html
我目前的解决方法是使用Java 6 JDK build 31.
更新:解决方法以使用较新的JDK
从Ant失败中启动Eclipse在Java 6u32和Java7u4引入了缺陷.Eclipse Bug#384757中报告了这个问题,包括允许您使用较新JDK的解决方法.
org.apache.xalan和org.apache.xml.serializer插件java.ext.dirs属性中列出的目录我使用以下目录,因为它们是默认定义的,与JDK版本无关:
C:\Windows\Sun\Java\lib\ext/Users/$USER/Library/Java/Extensions向Oracle报告了根问题,但该bug不再存在于他们的bug数据库中.我不乐观它将永远修复.
更新:Apache修复了Ant中的问题
Apache修复了根本问题; 它可能在Ant 1.9.0版本中可用(Apache Bug#54641).
更新:针对Eclipse 4.4安排的Ant 1.9.1
正如@OliBlogger所提到的,Apache修复了Ant 1.9.1中的根本问题.Eclipse计划在Eclipse 4.4中更新到Ant 1.9.1(也许更早,Eclipse bug系统还没有4.3.x的里程碑).
更新:已在Eclipse 4.4中修复
我确认我的构建现在成功使用Java 7 JDK build 67和Ant 1.9.2与Eclipse 4.4.1(Windows 7)一起分发,而不使用Orbit插件解决方法.
请尝试转到Preferences->Ant->Runtime并将Ant Home ...设置为您的ant安装文件夹.默认情况下,eclipse附带并使用作为插件提供的ant.
如果需要,您还可以添加其他罐子,文件夹.
| 归档时间: |
|
| 查看次数: |
18568 次 |
| 最近记录: |