<bdo id='bcJ29'></bdo><ul id='bcJ29'></ul>

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

    1. <tfoot id='bcJ29'></tfoot>

    2. <legend id='bcJ29'><style id='bcJ29'><dir id='bcJ29'><q id='bcJ29'></q></dir></style></legend>

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

    3. Travis、Maven 和 Sonarcloud 的失败github

      Sonarcloud failure with Travis, Maven amp; github(Travis、Maven 和 Sonarcloud 的失败github)
      <legend id='ThecC'><style id='ThecC'><dir id='ThecC'><q id='ThecC'></q></dir></style></legend><tfoot id='ThecC'></tfoot>

        <bdo id='ThecC'></bdo><ul id='ThecC'></ul>

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

                <i id='ThecC'><tr id='ThecC'><dt id='ThecC'><q id='ThecC'><span id='ThecC'><b id='ThecC'><form id='ThecC'><ins id='ThecC'></ins><ul id='ThecC'></ul><sub id='ThecC'></sub></form><legend id='ThecC'></legend><bdo id='ThecC'><pre id='ThecC'><center id='ThecC'></center></pre></bdo></b><th id='ThecC'></th></span></q></dt></tr></i><div id='ThecC'><tfoot id='ThecC'></tfoot><dl id='ThecC'><fieldset id='ThecC'></fieldset></dl></div>
                  <tbody id='ThecC'></tbody>
                本文介绍了Travis、Maven 和 Sonarcloud 的失败github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我从事的一个项目(eclipse/scanning)使用 Travis 和 Sonar 进行持续集成和代码分析.

                A project I work on (eclipse/scanning) uses Travis and Sonar for continuous integration and code analysis.

                上周,我注意到构建在声纳步骤失败:

                Last week, I noticed that builds were failing at the sonar step with:

                ERROR: Error during SonarQube Scanner execution
                org.sonar.squidbridge.api.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property
                

                经过一些研究,我想我会通过更新 修复这个code>addons: 部分(sonarqubesonarcloud)并切换到使用 - mvn -q sonar:sonar 而不是 - .travis.yml 文件的 script: 部分中的 sonar-scanner.

                After some research, I thought I'd fixed this by updating the addons: section (sonarqube to sonarcloud) and switching to using - mvn -q sonar:sonar rather than - sonar-scanner in the script: section of the .travis.yml file.

                但现在,通过集成测试的外部拉取请求(来自分叉)在声纳步骤由于不同的原因而失败:

                Now though, external pull requests (from forks) which make it past the integration tests are failing for a different reason at the sonar step:

                $ mvn -q sonar:sonar
                ...
                [ERROR] SonarQube server [http://localhost:9000] can not be reached
                
                [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project org.eclipse.scanning: Unable to execute SonarQube: Fail to get bootstrap index from server: Failed to connect to localhost/127.0.0.1:9000: Connection refused (Connection refused) -> [Help 1]
                

                这似乎与日志中的早期差异有关:

                This appears to be related to earlier differences in the log:

                Encrypted environment variables have been removed for security reasons.
                See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
                

                还有一个完全缺失的 SonarCloud 插件部分.

                and an entirely missing SonarCloud addon section.

                要查看差异,请比较 失败的构建 #625(其中是来自分叉仓库的拉取请求)与 成功构建 #628 (这是来自 repo 的拉取请求).

                To see the difference, compare the failed build #625 (which was a pull request from a forked repo) with the successful build #628 (which was a pull request from within the repo).

                大约一个月前,外部拉取工作没有问题,例如 build #536 已通过,已正确运行 Setting environment variables from repository settingsSonarCloud addonsonar-scanner.

                Around a month ago, external pulls work without issue, for instance build #536 passed, having run Setting environment variables from repository settings, SonarCloud addon and sonar-scanner correctly.

                随后的构建,例如 构建 #538 已通过,但仅因为 sonar-scanner 跳过了分析并且 exited with 0 即使它们未能运行.

                Subsequent builds however, such as build #538 passed, but only because sonar-scanner skipped analysis and exited with 0 even though they failed to run.

                虽然我可能只是在外部拉取请求上禁用 Sonar,但如果我能修复我们的存储库,这样我们就可以对内部和外部拉取请求进行集成测试和代码分析,所以

                While I could probably just disable Sonar on external pull requests, it would be nice if I could fix our repository so we got both integration tests and code analysis on both internal and external pull requests, so

                • 我原来的修复是正确的吗?
                  • 如果是这样,我如何让它同时处理内部和外部拉取请求?
                  • 如果没有,我应该如何解决原来的问题?

                  注意,这个问题已被 How do I get Sonarcloud to run on pull requests from forks with Travis, Maven &github 专注于根本问题,而不是试图解决一些症状.

                  Note, this question has been superceded by How do I get Sonarcloud to run on pull requests from forks with Travis, Maven & github which is focussed on the underlying problem rather than trying to fix some of the symptoms.

                  推荐答案

                  您的 PR 分析正在尝试(但失败)使用默认服务器:localhost:9000.

                  Your PR analysis is attempting (and failing) to use the default server: localhost:9000.

                  在另一种情况下,您会 更新 settings.xml 以指定位置,但由于您使用的是 Travis,因此您将在命令行中传递它:mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io

                  In another circumstance, you would update settings.xml to specify the location but since you're using Travis, you'll pass it on the command line instead: mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io

                  顺便说一句,这在您的常规 Travis 构建中有效,因为 Travis 的 SonarQube 集成专门是 Travis-SonarCloud 集成,因此服务器会自动填充.

                  BTW, this is working in your normal Travis build because the SonarQube integration for Travis is specifically a Travis-SonarCloud integration, so server is filled in automatically.

                  这篇关于Travis、Maven 和 Sonarcloud 的失败github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 等)

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

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

                          <bdo id='Yj653'></bdo><ul id='Yj653'></ul>
                        • <legend id='Yj653'><style id='Yj653'><dir id='Yj653'><q id='Yj653'></q></dir></style></legend>