Jenkins Jacoco 插件未链接 Groovy 个源文件
Jenkins Jacoco Plugin not linking Groovy source files
有没有办法将 Jenkins Jacoco 插件配置为 link Groovy 源文件到覆盖率报告?覆盖率统计计算正确,但是,在混合 Java/Groovy 项目中,只有 Java 文件被 linked。配置如下所示:
基于 this bug report,2.2+ 版本似乎更改了报告中源代码的链接方式,使其仅适用于 *.java 文件。一种可能的解决方法是将 JaCoCo 插件降级到 2.1.0。这就是我们所做的并且有效;尽管我不确定我们在 2.2+ 中放弃了哪些功能和错误修复,因此在您的情况下可能不值得。
看起来有 a Pull Request 需要审核和合并,以便在即将发布的版本中发布。
切换到最新版本 (3.0.3) 我能够解决该问题。但是您仍然需要手动告诉插件检查 *.groovy
源文件,例如:
jacoco classPattern: 'build/classes',
execPattern: 'build/jacoco/test.exec',
sourceInclusionPattern: '**/*.groovy', // new option required to tell the plugin to search for *.groovy source files
sourcePattern: 'src,test'
有没有办法将 Jenkins Jacoco 插件配置为 link Groovy 源文件到覆盖率报告?覆盖率统计计算正确,但是,在混合 Java/Groovy 项目中,只有 Java 文件被 linked。配置如下所示:
基于 this bug report,2.2+ 版本似乎更改了报告中源代码的链接方式,使其仅适用于 *.java 文件。一种可能的解决方法是将 JaCoCo 插件降级到 2.1.0。这就是我们所做的并且有效;尽管我不确定我们在 2.2+ 中放弃了哪些功能和错误修复,因此在您的情况下可能不值得。
看起来有 a Pull Request 需要审核和合并,以便在即将发布的版本中发布。
切换到最新版本 (3.0.3) 我能够解决该问题。但是您仍然需要手动告诉插件检查 *.groovy
源文件,例如:
jacoco classPattern: 'build/classes',
execPattern: 'build/jacoco/test.exec',
sourceInclusionPattern: '**/*.groovy', // new option required to tell the plugin to search for *.groovy source files
sourcePattern: 'src,test'