更新:在Caleb的答案中查看解决方案
我正在尽力使Coverity可以用于我的构建,但到目前为止收效甚微。
首先是细节:
我首先从https://scan.coverity.com/download/java/win64下载一个程序包
然后,将bin目录添加到我的路径,转到项目根目录并运行以下命令。
$ set PATH=%PATH%;C:\Users\dimit\sandbox\cov-analysis\bin
$ gradlew clean
$ cov-build --dir cov-int gradlew jar
前两个按预期进行,最后一个-没那么多:
Coverity Build Capture (32-bit) version 8.7.0 on Windows 10 Professional, 64-bit (build 14393)
Internal version numbers: b452b3f2c8 p-lodi-push-28091.612
The system cannot execute the specified program.
[WARNING] Build command gradlew.bat jar exited with code 1. Please verify that the build completed successfully.
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
For more details, please look at:
C:/Users/dimit/sandbox/nuggets/cov-int/build-log.txt
我将构建日志放在这里:https://gist.github.com/ddimtirov/9daa0e9f1f0954453f01fcec42ae2198
说明页面上的“对构建失败进行故障排除”指向一个论坛索引页面,该页面完全没有帮助:https://software-community-synopsys.force.com/s/#4838
继续前进,我认为如果我只能以其他方式生成数据,则可以将其上传到扫描服务并绕过该问题。我发现https://github.com/mjdetullio/gradle-coverity-plugin
Gradle Coverity插件发出了数据,但是当我将其压缩并上传到扫描服务时,它把错误电子邮件拒之门外。
作为最后的选择,我尝试了TravisCI集成-经过几次尝试,我没有出现任何错误地完成了它,但是它似乎没有上传任何东西...
https://travis-ci.org/ddimtirov/nuggets/builds/196307253
https://scan.coverity.com/projects/ddimtirov-nuggets?tab=overview
我快要放弃了(顺便说一句,没有在线可用的文档无济于事)
最佳答案
问题1-“系统无法执行指定的程序。”
出现此问题的原因是,使用Windows 32位工具包 try catch Windows 64位版本。将32位进程附加到64位进程的尝试导致执行失败。
问题2-无法捕获Linux上的TravisCI构建
此问题似乎是由于Coverity的Java Capture与ErrorProne插件之间的不兼容所致,如构建日志中的此类消息所证明的那样:
WARNING: Failed load class file java/io/FileNotFoundException.class as a resource using the class loader net.ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader@36358417
瓦里亚