<tfoot id='OtRtp'></tfoot>

    <legend id='OtRtp'><style id='OtRtp'><dir id='OtRtp'><q id='OtRtp'></q></dir></style></legend>

    <small id='OtRtp'></small><noframes id='OtRtp'>

    1. <i id='OtRtp'><tr id='OtRtp'><dt id='OtRtp'><q id='OtRtp'><span id='OtRtp'><b id='OtRtp'><form id='OtRtp'><ins id='OtRtp'></ins><ul id='OtRtp'></ul><sub id='OtRtp'></sub></form><legend id='OtRtp'></legend><bdo id='OtRtp'><pre id='OtRtp'><center id='OtRtp'></center></pre></bdo></b><th id='OtRtp'></th></span></q></dt></tr></i><div id='OtRtp'><tfoot id='OtRtp'></tfoot><dl id='OtRtp'><fieldset id='OtRtp'></fieldset></dl></div>
          <bdo id='OtRtp'></bdo><ul id='OtRtp'></ul>
      1. Bamboo + sonar.dynamicAnalysis=reuseReports = 0% 规则合规性

        Bamboo + sonar.dynamicAnalysis=reuseReports = 0% Rules Compliance(Bamboo + sonar.dynamicAnalysis=reuseReports = 0% 规则合规性)
          <bdo id='9CPjT'></bdo><ul id='9CPjT'></ul>
          <tfoot id='9CPjT'></tfoot>

          • <i id='9CPjT'><tr id='9CPjT'><dt id='9CPjT'><q id='9CPjT'><span id='9CPjT'><b id='9CPjT'><form id='9CPjT'><ins id='9CPjT'></ins><ul id='9CPjT'></ul><sub id='9CPjT'></sub></form><legend id='9CPjT'></legend><bdo id='9CPjT'><pre id='9CPjT'><center id='9CPjT'></center></pre></bdo></b><th id='9CPjT'></th></span></q></dt></tr></i><div id='9CPjT'><tfoot id='9CPjT'></tfoot><dl id='9CPjT'><fieldset id='9CPjT'></fieldset></dl></div>
            <legend id='9CPjT'><style id='9CPjT'><dir id='9CPjT'><q id='9CPjT'></q></dir></style></legend>

                <tbody id='9CPjT'></tbody>
              1. <small id='9CPjT'></small><noframes id='9CPjT'>

                  本文介绍了Bamboo + sonar.dynamicAnalysis=reuseReports = 0% 规则合规性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Bamboo 可以进行持续构建,但希望使用 Sonar 进行质量指标跟踪.必须在 Bamboo 中捕获单元测试通过/失败和 Clover 代码覆盖率指标.但是,这些相同的值也应该发送到 Sonar,以免通过两次运行单元测试和 Clover 来增加构建持续时间.

                  Bamboo is in place to do continuous builds, but want to use Sonar for quality metrics tracking. Unit test pass/fail and Clover code coverage metrics must be captured in Bamboo. But, these same values should be sent to Sonar as well, so as to not increase build duration by running unit tests and Clover twice.

                  已经能够使用带有 maven 构建的sonar.dynamicAnalysis=reuseReports"指令将这些指标从 Bamboo 构建发送到 Sonar.但 Sonar 中的规则合规性"指标为 0%.

                  Have been able to send these metrics from Bamboo builds to Sonar using "sonar.dynamicAnalysis=reuseReports" directive with the maven build. But the "Rules Compliance" metric in Sonar goes to 0%.

                  根据之前未使用指令的修改,规则合规性得分较高.所以很明显,使用该指令会以某种方式阻止计算该指标.

                  Based on prior tinkering without using the directive the Rules Compliance score is higher. So it's clear using the directive is somehow preventing that metric from being calculated.

                  有人知道如何使用该指令并获得规则合规分数吗?或者他们能指出一些可以帮助诊断的东西吗?使用-e"选项运行 maven 并没有提供任何特别有用的东西.

                  Does anyone know how to use this directive and get a Rules Compliance score? Or can they point out something to look at to help diagnose? Running maven with the "-e" option has not provided anything particularly useful.

                  推荐答案

                  经过多次反复试验,我终于能够让 Sonar、Jacoco 和 Bamboo 和谐地合作.我记录了这里的过程,但我会复制我的此处的解决方案,以确保它始终可用.

                  After much trail and error, I finally was able to get Sonar, Jacoco, and Bamboo working harmoniously together. I documented the process here!, but I'll copy my solution here to ensure it's always available.

                  对于我的应用程序,我实际上使用了声纳亚军任务.您有更明确的步骤来安装和配置 sonar-runner,安装指南中没有提到.首先,您必须安装 sonar-runner 并在 sonar-runner.properties 中指定以下属性:

                  For my application, I actually used a sonar runner tasks. You have more explicit steps to install and configure the sonar-runner, which isn't mentioned in the install guide. First, you must install the sonar-runner and specify the following properties in your sonar-runner.properties:

                  #----- Default Sonar server
                  sonar.host.url=http://localhost:9000
                  
                  #sonar.jdbc.url=jdbc:postgresql://localhost/sonar
                  #sonar.jdbc.driver=org.postgresql.Driver
                  
                  #----- Global database settings
                  sonar.jdbc.username=user
                  sonar.jdbc.password=passwd
                  

                  在顶部的 ant 构建脚本中包含 jacoco xmlns:

                  Include the jacoco xmlns in your ant build script at the top:

                  <project basedir="." default="build" name="project" xmlns:jacoco="antlib:org.jacoco.ant">
                      <property environment="env" />
                  
                      <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
                         <classpath path="libs/independent/jacocoant.jar"/>
                      </taskdef>
                  

                  接下来,您必须将 jacoco 覆盖添加到您的 ant 构建脚本中:

                  Next, you have to add jacoco coverage to your ant build script:

                  <jacoco:coverage enabled="${tests.code.coverage}" destfile="${jacoco.exec.dest}">
                      <junit fork="yes" printsummary="withOutAndErr" dir="${tests.working.dir}">
                      ...
                  

                  最后,您需要告诉来自竹子的声纳使用 jacoco 结果并重用您构建中生成的报告.您可以通过将以下属性添加到任务配置中的自定义额外参数"以在 Bamboo 作业中进行声纳分析.配置以下选项:

                  Last, you need to tell sonar, from bamboo, to use jacoco results and reuse the reports generated in your build. You do this by adding the following properties to your "Custom Extra Parameters" in the Task configure for sonar analysis in the Bamboo Job. Configure the following options:

                  -DbuildNumber=${bamboo.buildNumber}
                  -Dsonar.core.codeCoveragePlugin=jacoco
                  -Dsonar.jacoco.reportPath=tests/jacoco-exec/jacoco.exec
                  -Dsonar.dynamicAnalysis=reuseReports
                  -Dsonar.surefire.reportsPath=tests/test-reports
                  

                  配置完所有这些后,我的测试覆盖率开始显示在声纳中,列出了 # 个成功的测试.

                  Once I had all this configured, my test coverage started showing up in sonar with the # successful tests listed.

                  请确保您设置了 sunfire 属性以重用它们从您的单元测试中生成的报告.否则,即使您告诉声纳重复使用报告,声纳也不知道在哪里找到它们.希望对您下次尝试有所帮助.

                  Just be sure you set the sunfire property to reuse their reports generated from your unit tests. Otherwise, sonar won't know where to find them even if you tell it to reuse reports. Hope that helps at your next attempt.

                  这篇关于Bamboo + sonar.dynamicAnalysis=reuseReports = 0% 规则合规性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Slf4j LoggerFactory.getLogger and sonarqube(Slf4j LoggerFactory.getLogger 和 sonarqube)
                  Security - Array is stored directly(安全性 - 数组直接存储)
                  SonarQube quot;Class Not Foundquot; during Main AST Scan(SonarQube“找不到类在主 AST 扫描期间)
                  Integrate Spock#39;s test with Sonar(将 Spock 的测试与声纳集成)
                  How do I make Hudson/Jenkins fail if Sonar thresholds are breached?(如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?)
                  automatically add curly brackets to all if/else/for/while etc. in a java code-base(自动将大括号添加到 java 代码库中的所有 if/else/for/while 等)
                  <legend id='8FvRE'><style id='8FvRE'><dir id='8FvRE'><q id='8FvRE'></q></dir></style></legend>
                  <i id='8FvRE'><tr id='8FvRE'><dt id='8FvRE'><q id='8FvRE'><span id='8FvRE'><b id='8FvRE'><form id='8FvRE'><ins id='8FvRE'></ins><ul id='8FvRE'></ul><sub id='8FvRE'></sub></form><legend id='8FvRE'></legend><bdo id='8FvRE'><pre id='8FvRE'><center id='8FvRE'></center></pre></bdo></b><th id='8FvRE'></th></span></q></dt></tr></i><div id='8FvRE'><tfoot id='8FvRE'></tfoot><dl id='8FvRE'><fieldset id='8FvRE'></fieldset></dl></div>

                      <small id='8FvRE'></small><noframes id='8FvRE'>

                        <bdo id='8FvRE'></bdo><ul id='8FvRE'></ul>
                      • <tfoot id='8FvRE'></tfoot>
                              <tbody id='8FvRE'></tbody>