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

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

    1. <legend id='EtRIj'><style id='EtRIj'><dir id='EtRIj'><q id='EtRIj'></q></dir></style></legend>

      <tfoot id='EtRIj'></tfoot>

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

      1. 运行 sonarrunner 时找不到类错误

        Class not found error when running sonarrunner(运行 sonarrunner 时找不到类错误)

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

        <tfoot id='kjRPV'></tfoot>
        • <bdo id='kjRPV'></bdo><ul id='kjRPV'></ul>
              <tbody id='kjRPV'></tbody>
          • <small id='kjRPV'></small><noframes id='kjRPV'>

                <legend id='kjRPV'><style id='kjRPV'><dir id='kjRPV'><q id='kjRPV'></q></dir></style></legend>
                  本文介绍了运行 sonarrunner 时找不到类错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我收到类未找到错误.该类无法通过类加载器访问,并且从 gradle 运行 sonarrunner 时会提示错误.

                  I am getting class not found error. The the class is not accessible through class loader and an error is being prompt when running the sonarrunner from gradle.

                  这些类在 gradle 中作为编译时的依赖项包含在内,并且 gradle build 可以正常工作.如何为声纳包含这些类?

                  These classes are included as dependencies in compile time in gradle and gradle build works fine. How to include these classes for sonar ?

                      14:53:24.322 INFO  - Load module settings
                  14:53:24.335 INFO  - Base dir: /Users/srao1/Documents/GradleTest/lds_warehouse/lds_warehouse_base
                  14:53:24.335 INFO  - Working dir: /Users/srao1/Documents/GradleTest/lds_warehouse/build/sonar/lds_warehouse_lds_warehouse_base
                  14:53:24.336 INFO  - Source paths: src
                  14:53:24.336 INFO  - Test paths: test
                  14:53:24.336 INFO  - Binary dirs: build/classes/main
                  14:53:24.336 INFO  - Source encoding: UTF-8, default locale: en_US
                  14:53:24.336 INFO  - Index files
                  14:53:24.444 INFO  - 50 files indexed
                  14:53:24.593 INFO  - Quality profile for java: Sonar way
                  14:53:24.604 INFO  - Sensor JavaSquidSensor
                  14:53:24.620 WARN  - sonar.binaries and sonar.libraries are deprecated since version 2.5 of sonar-java-plugin, please use sonar.java.binaries and sonar.java.libraries instead
                  14:53:24.628 INFO  - Java Main Files AST scan...
                  14:53:24.628 INFO  - 45 source files to be analyzed
                  14:53:25.070 ERROR - Class not found: com.lim.dw.dao.base.bean.WarehouseFeed
                  14:53:25.070 ERROR - Class not found: com.lim.dw.dao.base.bean.PhaseTimer
                  14:53:32.459 WARN  - Class 'com/lim/lds/LdsDataFeed' is not accessible through the ClassLoader.
                  14:53:32.459 WARN  - Class 'com/lim/lds/LdsDataFeed' is not accessible through the ClassLoader.
                  14:53:32.459 WARN  - Class 'com/lim/logger/Logger' is not accessible through the ClassLoader.
                  14:53:32.459 WARN  - Class 'com/lim/logger/Logger' is not accessible through the ClassLoader.
                  14:53:32.477 INFO  - Java bytecode scan done: 162 ms
                  14:53:32.477 INFO  - Java Test Files AST scan...
                  14:53:32.477 INFO  - 5 source files to be analyzed
                  14:53:32.727 INFO  - Java Test Files AST scan done: 250 ms
                  14:53:32.728 INFO  - 5/5 source files have been analyzed
                  14:53:32.728 INFO  - Package design analysis...
                  14:53:32.800 INFO  - Package design analysis done: 72 ms
                  14:53:32.889 INFO  - Sensor JavaSquidSensor (done) | time=8285ms
                  14:53:32.889 INFO  - Sensor Lines Sensor
                  14:53:32.892 INFO  - Sensor Lines Sensor (done) | time=3ms
                  14:53:32.892 INFO  - Sensor QProfileSensor
                  14:53:32.894 INFO  - Sensor QProfileSensor (done) | time=2ms
                  14:53:32.904 INFO  - Sensor InitialOpenIssuesSensor
                  14:53:33.016 INFO  - Sensor InitialOpenIssuesSensor (done) | time=112ms
                  14:53:33.016 INFO  - Sensor ProjectLinksSensor
                  14:53:33.018 INFO  - Sensor ProjectLinksSensor (done) | time=2ms
                  14:53:33.018 INFO  - Sensor VersionEventsSensor
                  14:53:33.023 INFO  - Sensor VersionEventsSensor (done) | time=5ms
                  14:53:33.023 INFO  - Sensor SurefireSensor
                  14:53:33.023 INFO  - parsing /Users/srao1/Documents/GradleTest/lds_warehouse/lds_warehouse_base/target/surefire-reports
                  14:53:33.023 ERROR - Reports path not found or is not a directory: /Users/srao1/Documents/GradleTest/lds_warehouse/lds_warehouse_base/target/surefire-reports
                  14:53:33.023 INFO  - Sensor SurefireSensor (done) | time=0ms
                  14:53:33.023 INFO  - Sensor JaCoCoOverallSensor
                  14:53:33.037 WARN  - You are not using the latest JaCoCo binary format version, please consider upgrading to latest JaCoCo version.
                  14:53:33.037 INFO  - Analysing /Users/srao1/Documents/GradleTest/lds_warehouse/lds_warehouse_base/build/jacoco/jacocoTest.exec
                  14:53:33.072 WARN  - You are not using the latest JaCoCo binary format version, please consider upgrading to latest JaCoCo version.
                  14:53:33.072 INFO  - Analysing /Users/srao1/Documents/GradleTest/lds_warehouse/build/sonar/lds_warehouse_lds_warehouse_base/jacoco-overall.exec
                  14:53:33.234 INFO  - No information about coverage per test.
                  14:53:33.234 INFO  - Sensor JaCoCoOverallSensor (done) | time=211ms
                  14:53:33.234 INFO  - Sensor SCM Sensor
                  14:53:33.234 INFO  - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
                  14:53:33.234 INFO  - Sensor SCM Sensor (done) | time=0ms
                  14:53:33.234 INFO  - Sensor JaCoCoSensor
                  14:53:33.236 WARN  - You are not using the latest JaCoCo binary format version, please consider upgrading to latest JaCoCo version.
                  14:53:33.236 INFO  - Analysing /Users/srao1/Documents/GradleTest/lds_warehouse/lds_warehouse_base/build/jacoco/jacocoTest.exec
                  14:53:33.306 INFO  - No information about coverage per test.
                  14:53:33.306 INFO  - Sensor JaCoCoSensor (done) | time=72ms
                  14:53:33.306 INFO  - Sensor CPD Sensor
                  14:53:33.306 INFO  - JavaCpdEngine is used for java
                  14:53:33.307 INFO  - Cross-project analysis disabled
                  14:53:33.545 INFO  - Sensor CPD Sensor (done) | time=239ms
                  14:53:33.546 INFO  - No quality gate is configured.
                  14:53:33.549 INFO  - Compare to previous analysis (2015-07-23)
                  14:53:33.550 INFO  - Compare over 30 days (2015-06-24, analysis of Wed Jul 22 16:29:23 CDT 2015)
                  14:53:33.716 INFO  - Execute decorators...
                  

                  推荐答案

                  要执行源代码分析,SQ Java 插件除了源代码之外还需要字节码.源文件的字节码位置由 sonar.java.binariessonar.java.test.binaries 属性提供.第三方库的字节码(或 JAR)位置由属性 sonar.java.librariessonar.java.test.libraries 提供.

                  To perform source code analysis the SQ Java plugin needs bytecode in addition to the source code. Bytecode location for source files is provided thanks to properties sonar.java.binaries and sonar.java.test.binaries. Bytecode (or JAR) locations for third party libs is provided by properties sonar.java.libraries and sonar.java.test.libraries.

                  如果您没有正确提供这些属性,那么您会看到一些找不到类"错误.这并不妨碍完成分析,但许多 SQ Java 规则可能不起作用,也不会检测到任何问题.

                  If you don't provide correctly those properties then you'll see some 'Class not found' errors. That doesn't prevent to complete the analysis but many SQ Java rules will probably not work and not detect any issue.

                  (部分)示例:sonar-runner -Dsonar.sources=src -Dsonar.java.binaries=bin/classes -Dsonar.java.libraries=libs/*.jar

                  这篇关于运行 sonarrunner 时找不到类错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

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

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

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

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

                            <tbody id='Z3auB'></tbody>
                            <legend id='Z3auB'><style id='Z3auB'><dir id='Z3auB'><q id='Z3auB'></q></dir></style></legend>