<tfoot id='VNR1T'></tfoot>

      • <bdo id='VNR1T'></bdo><ul id='VNR1T'></ul>
    1. <legend id='VNR1T'><style id='VNR1T'><dir id='VNR1T'><q id='VNR1T'></q></dir></style></legend>

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

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

        API 与 SonarQube 5.6 和 Java Analyzer 4.0 与 Findbugs 3.3 或 Cob

        时间:2024-05-09
        1. <tfoot id='4FfLn'></tfoot>

          <small id='4FfLn'></small><noframes id='4FfLn'>

              <tbody id='4FfLn'></tbody>
          • <legend id='4FfLn'><style id='4FfLn'><dir id='4FfLn'><q id='4FfLn'></q></dir></style></legend>

              <bdo id='4FfLn'></bdo><ul id='4FfLn'></ul>
              <i id='4FfLn'><tr id='4FfLn'><dt id='4FfLn'><q id='4FfLn'><span id='4FfLn'><b id='4FfLn'><form id='4FfLn'><ins id='4FfLn'></ins><ul id='4FfLn'></ul><sub id='4FfLn'></sub></form><legend id='4FfLn'></legend><bdo id='4FfLn'><pre id='4FfLn'><center id='4FfLn'></center></pre></bdo></b><th id='4FfLn'></th></span></q></dt></tr></i><div id='4FfLn'><tfoot id='4FfLn'></tfoot><dl id='4FfLn'><fieldset id='4FfLn'></fieldset></dl></div>
                  本文介绍了API 与 SonarQube 5.6 和 Java Analyzer 4.0 与 Findbugs 3.3 或 Cobertura 1.6.3 不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在将 Java 插件 从版本 3.14 更新到 4.05.6 对我的项目的分析失败了代码>.

                  The analyzes of my projects are failing with SonarQube 5.6, after updating the Java Plugin from version 3.14 to 4.0.

                  在我的 SonarQube 实例中,除其他插件外,我目前有 Findbugs 插件(版本 3.3)和 Cobertura 插件(1.6.3),它们需要 Java 插件.

                  In my SonarQube instance, among other plugins, I currently have the Findbugs plugin (version 3.3) and the Cobertura plugin (1.6.3) which require the Java plugin.

                  查看日志,我收到以下消息:

                  Looking at the log, I get the following message:

                  [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1-build231:sonar (default-cli) 
                      on project MyProject: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1-build231:sonar failed:
                  
                      An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.1-build231:sonar: 
                  
                      java.lang.NoSuchMethodError:
                      org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
                  
                  ...
                  
                  Caused by: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
                      at org.sonar.plugins.findbugs.FindbugsSensor.analyse(FindbugsSensor.java:108)
                      at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
                      at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
                      at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
                      at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
                      at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
                      at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
                      at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
                      at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
                      at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
                      at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
                      at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
                      at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:498)
                      at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
                      at com.sun.proxy.$Proxy21.execute(Unknown Source)
                      at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
                      at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
                      at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
                      at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
                      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
                      ... 20 more
                  

                  我应该怎么做才能让我的分析不失败?

                  What should I do to get my analysis not failing?

                  推荐答案

                  SonarQube Java Analyzer4.0 版本对其 API 进行了更改,以保持与SonarQube 5.6 LTS(长期支持)的新 API.

                  Version 4.0 of the SonarQube Java Analyzer introduced changes in its API, in order to stay aligned with the new API of SonarQube 5.6 LTS (Long Term Support).

                  不幸的是,这些更改可能会破坏与直接依赖于 Java 分析器的插件的兼容性.如果最新发布的 PMDCheckstyle 插件版本不受影响,那么很遗憾 Findbugs 的版本 3.3 不兼容以及 Cobertura 插件的 1.6.3 版本.

                  Unfortunately, these changes potentially broke compatibility with plugin directly relying on the Java Analyzer. If last released versions of PMD and Checkstyle plugins are not affected, version 3.3 of the Findbugs is unfortunately not compatible anymore, as well as version 1.6.3 of the Cobertura plugin.

                  为了解决 Findbugs 的问题,您有以下选择:

                  In order to solve the issue with Findbugs, you have the following option:

                  • 更新到 Findbugs 插件的 >= 3.4 版本,该插件目前处于请求反馈期(查看这个帖子),应该很快就会发布(已确认版本 3.4.2).
                  • 删除 Findbugs 插件或暂时禁用其规则.
                  • Update to version >= 3.4 of the Findbugs plugin, which is currently in Request For Feedback period (see this thread), and should be released soon (confirmed with version 3.4.2).
                  • Remove the Findbugs plugin or temporarily disable its rules.

                  对于 Cobertura 插件,更新到版本 >= 1.7(需要 LTS 5.6 和 Java 8),这可以解决问题.应该可以使用 SonarQube UI 获得更新.

                  For the Cobertura plugin, update to version >= 1.7 (requires LTS 5.6 and Java 8), which solve the issue. The update should be available using the SonarQube UI.

                  这篇关于API 与 SonarQube 5.6 和 Java Analyzer 4.0 与 Findbugs 3.3 或 Cobertura 1.6.3 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:制作“课堂"瞬态或可序列化但该类是可序列化的 下一篇:如何抑制“common-java"规则的警告

                  相关文章

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

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

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