• <legend id='TNOeF'><style id='TNOeF'><dir id='TNOeF'><q id='TNOeF'></q></dir></style></legend>

  • <tfoot id='TNOeF'></tfoot>

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

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

      • <bdo id='TNOeF'></bdo><ul id='TNOeF'></ul>

      1. 命令行中的 MSBuild SonarQube 运行器

        时间:2023-10-24
          <tbody id='SLUaz'></tbody>

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

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

                  <legend id='SLUaz'><style id='SLUaz'><dir id='SLUaz'><q id='SLUaz'></q></dir></style></legend>
                  本文介绍了命令行中的 MSBuild SonarQube 运行器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在使用 MSBuild SonarQube 运行程序分析项目时遇到问题.SonarQube 数据库和服务器已启动并正在运行,我尝试分析一个示例项目,一切顺利.但是当我尝试分析我的项目时,出现了问题.分析完成,没有错误,但没有分析数据保存到数据库,没有问题,没有代码行数,什么都没有.

                  I have a problem analyzing a project using MSBuild SonarQube runner. SonarQube database and server are up and running, i have tried to analyze an example project and it all went well. But when i try to analyze my project something goes wrong. The analysis completes with no errors but no analysis data is saved to database, no issues, no lines of code count, nothing.

                  有人知道可能出了什么问题吗?

                  Anyone has any idea of what could be wrong?

                  sonar-project.properties:

                  sonar-project.properties:

                  sonar.projectKey=shrooms
                  sonar.projectName=Shrooms
                  sonar.projectVersion=1.0
                  sonar.sources=.
                  

                  声纳属性:

                  sonar.jdbc.username=user
                  sonar.jdbc.password=pass
                  sonar.jdbc.url=jdbc:jtds:sqlserver://localhost;databaseName=SonarQubeDB;SelectMethod=Cursor
                  sonar.web.host=0.0.0.0
                  sonar.web.context=/sonarqube
                  sonar.web.port=9000
                  

                  SonarQube.Analysis.xml:

                  SonarQube.Analysis.xml:

                  <SonarQubeAnalysisProperties  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
                  
                    <Property Name="sonar.host.url">http://localhost:9000/sonarqube</Property>
                  
                  
                    <Property Name="sonar.login">admin</Property>
                    <Property Name="sonar.password">admin</Property>
                  
                  
                    <Property Name="sonar.jdbc.url">jdbc:jtds:sqlserver://localhost;databaseName=SonarQubeDB;SelectMethod=Cursor</Property>
                    <Property Name="sonar.jdbc.username">dbusername</Property>
                    <Property Name="sonar.jdbc.password">dbpassword</Property>
                  
                  </SonarQubeAnalysisProperties>
                  

                  在我运行分析后,服务器日志中只添加了一个新行:

                  In server log theres only one new line added after i run the analysis:

                  2015.07.30 17:02:29 INFO web[o.s.s.c.ComputationService] 项目shrooms分析(报告4)(完成) |时间=18179ms

                  2015.07.30 17:02:29 INFO web[o.s.s.c.ComputationService] Analysis of project shrooms (report 4) (done) | time=18179ms

                  MSBuild.SonarRunner 日志的最后几行:

                  Last lines of the MSBuild.SonarRunner log:

                  5:01:18 PM  17:01:18.906 INFO  - Execute decorators...
                  5:01:19 PM  17:01:19.969 INFO  - Store results in database
                  5:02:05 PM  17:02:05.266 INFO  - Analysis reports generated in 9578ms, dir size=82 KB
                  5:02:08 PM  17:02:08.922 INFO  - Analysis reports compressed in 3656ms, zip size=285 KB
                  5:02:10 PM  17:02:10.704 INFO  - Analysis reports sent to server in 1782ms
                  5:02:10 PM  17:02:10.704 INFO  - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/sonarqube
                  /dashboard/index/shrooms
                  5:02:10 PM  17:02:10.704 INFO  - Note that you will be able to access the updated dashboard once the
                   server has processed the submitted analysis report.
                  5:02:14 PM  INFO: ------------------------------------------------------------------------
                  5:02:14 PM  INFO: EXECUTION SUCCESS
                  5:02:14 PM  INFO: ------------------------------------------------------------------------
                  5:02:14 PM  Total time: 8:10.724s
                  5:02:14 PM  Final Memory: 14M/310M
                  5:02:14 PM  INFO: ------------------------------------------------------------------------
                  5:02:15 PM  Process returned exit code 0
                  5:02:15 PM  The sonar-runner has finished
                  5:02:15 PM  Creating a summary markdown file...
                  5:02:15 PM  Analysis results: http://localhost:9000/sonarqube/dashboard/index/shrooms
                  Process returned exit code 0
                  Post-processing succeeded.
                  

                  推荐答案

                  感谢您提供更多信息.

                  首先,您不再需要 sonar-project.properties 文件来使用 MSBuild SonarQube Runner 分析项目:将其从项目中删除.

                  First of all, you no longer need a sonar-project.properties file to analyze projects with the MSBuild SonarQube Runner: Remove it from your project.

                  您可能正在尝试分析其完整路径包含 test 的项目.这会导致将该项目检测为测试项目,并将其呈现为 SonarQube 中的测试(您在仪表板中看到的所有指标均来自实际来源,即不包括测试).

                  You probably are trying to analyze a project whose full path contains test. This leads to the detection of the project as a test one, and will render them as test in SonarQube (all the metrics you see in the dashboard are on actual sources, i.e. excluding tests).

                  要么从项目路径中删除 test,要么更新用于检测测试项目的正则表达式 SonarQube 属性:sonar.cs.msbuild.testProjectPattern

                  Either remove test from the project path, or update the regular expression SonarQube property used to detect test projects: sonar.cs.msbuild.testProjectPattern

                  仅供参考 - 此测试检测机制将在即将发布的版本中更新,因为从包含 test 的文件夹中尝试 MSBuild SonarQube Runner 是很常见的场景:http://jira.sonarsource.com/browse/SONARMSBRU-121

                  FYI - this test detection mechanism will be updated in an upcoming release as trying out the MSBuild SonarQube Runner from a folder containing test is quite a common scenario: http://jira.sonarsource.com/browse/SONARMSBRU-121

                  这篇关于命令行中的 MSBuild SonarQube 运行器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Sonarqube v.4 TFS 任务“发布分析结果"抛出错误“无法获取指标" 下一篇:如何为 SonarQube 创建自己的 C# 自定义规则?

                  相关文章

                1. <small id='1vDXG'></small><noframes id='1vDXG'>

                2. <tfoot id='1vDXG'></tfoot>
                  • <bdo id='1vDXG'></bdo><ul id='1vDXG'></ul>

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