英文:
How can generate the jacoco report from Android studio and export it to sonarqube, as am getting the code coverage as zero(jacoco+gradle+sonarqube)
问题
INFO: 扫描器配置文件: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: 项目根配置文件: 无
INFO: SonarScanner 4.3.0.2102
INFO: Java 12.0.1 Oracle Corporation (64位)
INFO: Mac OS X 10.15.6 x86_64
INFO: 用户缓存: /Users/fenix2/.sonar/cache
INFO: 扫描器配置文件: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: 项目根配置文件: 无
INFO: 在 SonarQube 服务器 8.4.1 上进行分析
INFO: 默认区域设置: "en_US", 源代码编码: "UTF-8" (分析依赖于平台)
INFO: 加载全局设置
INFO: 加载全局设置 (完成) | 时间=55ms
INFO: 服务器标识: BF41A1F2-AXNnOo1V8h5sJwwrOZcS
INFO: 用户缓存: /Users/fenix2/.sonar/cache
INFO: 加载/下载插件
INFO: 加载插件索引
INFO: 加载插件索引 (完成) | 时间=33ms
INFO: 加载/下载插件 (完成) | 时间=112ms
INFO: 处理项目属性
INFO: 处理项目属性 (完成) | 时间=6ms
INFO: 执行项目构建器
INFO: 执行项目构建器 (完成) | 时间=2ms
INFO: 项目键: FenixGoNative
INFO: 基本目录: /Users/fenix2/Documents/LatestGo/FenixGoNative
INFO: 工作目录: /Users/fenix2/Documents/LatestGo/FenixGoNative/.scannerwork
INFO: 为组件键加载项目设置: 'FenixGoNative'
INFO: 加载为组件键加载项目设置: 'FenixGoNative' (完成) | 时间=36ms
INFO: 加载质量规则配置
INFO: 加载质量规则配置 (完成) | 时间=170ms
INFO: 加载活动规则
INFO: 加载活动规则 (完成) | 时间=2143ms
INFO: 正在索引文件...
INFO: 项目配置:
INFO: 已索引 1105 个文件
INFO: 由于源代码管理忽略设置,忽略 7825 个文件
INFO: Java 质量规则: Sonar way
INFO: Kotlin 质量规则: Sonar way
INFO: XML 质量规则: Sonar way
INFO: ------------- 在模块 FenixGoNative 上运行传感器
INFO: 加载指标存储库
INFO: 加载指标存储库 (完成) | 时间=13ms
WARNING: 发生了非法反射访问操作
WARNING: 非法反射访问来源于 net.sf.cglib.core.ReflectUtils$1
(文件:/Users/fenix2/.sonar/cache/52f5340dd05620cd162e2b9a45a57124/sonar-javascript-plugin.jar)
到方法
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: 请考虑向 net.sf.cglib.core.ReflectUtils$1 的维护者报告此问题
WARNING: 使用 --illegal-access=warn 启用进一步非法反射访问操作的警告
WARNING: 所有非法访问操作将在未来版本中被拒绝
INFO: 传感器 JavaSquidSensor [java]
INFO: 配置的 Java 源版本 (sonar.java.source): 无
INFO: JavaClasspath 初始化
WARN: 未提供依赖项的字节码以分析源文件,可能导致精度降低。可以使用 sonar.java.libraries 属性提供字节码。
INFO: JavaClasspath 初始化 (完成) | 时间=3ms
INFO: JavaTestClasspath 初始化
INFO: JavaTestClasspath 初始化 (完成) | 时间=0ms
INFO: Java 主文件 AST 扫描
INFO: 要分析的源文件 1 个
INFO: 加载项目存储库
INFO: 已分析 1/1 个源文件
INFO: Java 主文件 AST 扫描 (完成) | 时间=1104ms
INFO: Java 测试文件 AST 扫描
INFO: 没有要分析的源文件
INFO: Java 测试文件 AST 扫描 (完成) | 时间=1ms
INFO: 0/0 个源文件已分析
INFO: Java 生成的文件 AST 扫描
INFO: 没有要分析的源文件
INFO: Java 生成的文件 AST 扫描 (完成) | 时间=0ms
INFO: 0/0 个源文件已分析
INFO: 传感器 JavaSquidSensor [java] (完成) | 时间=1242ms
INFO: 传感器 SonarCSS 规则 [cssfamily]
INFO: 项目中未找到 CSS、PHP、HTML 或 VueJS 文件。跳过 CSS 分析。
INFO: 传感器 SonarCSS 规则 [cssfamily] (完成) | 时间=12ms
INFO: 传感器 JaCoCo XML 报告导入器 [jacoco]
WARN: 找不到覆盖率报告,使用默认位置:
target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: 未导入报告,JaCoCo XML 报告导入器将不导入覆盖率信息
INFO: 传感器 JaCoCo XML 报告导入器 [jacoco] (完成) | 时间=9ms
INFO: 传感器 Kotlin 传感器 [kotlin]
INFO: 要分析的源文件 689 个
INFO: 传感器 Kotlin 传感器 [kotlin] (完成) | 时间=4008ms
INFO: 已分析 689/689 个源文件
INFO: 传感器 SurefireSensor [java]
INFO: 解析 [/Users/fenix2/Documents/LatestGo/Fenix
英文:
> INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
> INFO: Project root configuration file: NONE
> INFO: SonarScanner 4.3.0.2102
> INFO: Java 12.0.1 Oracle Corporation (64-bit)
> INFO: Mac OS X 10.15.6 x86_64
> INFO: User cache: /Users/fenix2/.sonar/cache
> INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
> INFO: Project root configuration file: NONE
> INFO: Analyzing on SonarQube server 8.4.1
> INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
> INFO: Load global settings
> INFO: Load global settings (done) | time=55ms
> INFO: Server id: BF41A1F2-AXNnOo1V8h5sJwwrOZcS
> INFO: User cache: /Users/fenix2/.sonar/cache
> INFO: Load/download plugins
> INFO: Load plugins index
> INFO: Load plugins index (done) | time=33ms
> INFO: Load/download plugins (done) | time=112ms
> INFO: Process project properties
> INFO: Process project properties (done) | time=6ms
> INFO: Execute project builders
> INFO: Execute project builders (done) | time=2ms
> INFO: Project key: FenixGoNative
> INFO: Base dir: /Users/fenix2/Documents/LatestGo/FenixGoNative
> INFO: Working dir: /Users/fenix2/Documents/LatestGo/FenixGoNative/.scannerwork
> INFO: Load project settings for component key: 'FenixGoNative'
> INFO: Load project settings for component key: 'FenixGoNative' (done) | time=36ms
> INFO: Load quality profiles
> INFO: Load quality profiles (done) | time=170ms
> INFO: Load active rules
> INFO: Load active rules (done) | time=2143ms
> INFO: Indexing files...
> INFO: Project configuration:
> INFO: 1105 files indexed
> INFO: 7825 files ignored because of scm ignore settings
> INFO: Quality profile for java: Sonar way
> INFO: Quality profile for kotlin: Sonar way
> INFO: Quality profile for xml: Sonar way
> INFO: ------------- Run sensors on module FenixGoNative
> INFO: Load metrics repository
> INFO: Load metrics repository (done) | time=13ms
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1
> (file:/Users/fenix2/.sonar/cache/52f5340dd05620cd162e2b9a45a57124/sonar-javascript-plugin.jar)
> to method
> java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
> WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
> WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> INFO: Sensor JavaSquidSensor [java]
> INFO: Configured Java source version (sonar.java.source): none
> INFO: JavaClasspath initialization
> WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can
> be provided using sonar.java.libraries property.
> INFO: JavaClasspath initialization (done) | time=3ms
> INFO: JavaTestClasspath initialization
> INFO: JavaTestClasspath initialization (done) | time=0ms
> INFO: Java Main Files AST scan
> INFO: 1 source files to be analyzed
> INFO: Load project repositories
> INFO: Load project repositories (done) | time=349ms
> INFO: 1/1 source files have been analyzed
> INFO: Java Main Files AST scan (done) | time=1104ms
> INFO: Java Test Files AST scan
> INFO: 0 source files to be analyzed
> INFO: Java Test Files AST scan (done) | time=1ms
> INFO: 0/0 source files have been analyzed
> INFO: Java Generated Files AST scan
> INFO: 0 source files to be analyzed
> INFO: Java Generated Files AST scan (done) | time=0ms
> INFO: 0/0 source files have been analyzed
> INFO: Sensor JavaSquidSensor [java] (done) | time=1242ms
> INFO: Sensor SonarCSS Rules [cssfamily]
> INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
> INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=12ms
> INFO: Sensor JaCoCo XML Report Importer [jacoco]
> WARN: No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='presentation/build/test-results/testTrainDebugUnitTest,data/build/test-results/testTrainDebugUnitTest'.
> Using default locations:
> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
> INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
> INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
> INFO: Sensor Kotlin Sensor [kotlin]
> INFO: 689 source files to be analyzed
> INFO: Sensor Kotlin Sensor [kotlin] (done) | time=4008ms
> INFO: 689/689 source files have been analyzed
> INFO: Sensor SurefireSensor [java]
> INFO: parsing [/Users/fenix2/Documents/LatestGo/FenixGoNative/target/surefire-reports]
> INFO: Sensor SurefireSensor [java] (done) | time=1ms
> INFO: Sensor JavaXmlSensor [java]
> INFO: 277 source files to be analyzed
> INFO: Sensor JavaXmlSensor [java] (done) | time=807ms
> INFO: 277/277 source files have been analyzed
> INFO: Sensor HTML [web]
> INFO: Sensor HTML [web] (done) | time=4ms
> INFO: Sensor XML Sensor [xml]
> INFO: 277 source files to be analyzed
> INFO: Sensor XML Sensor [xml] (done) | time=667ms
> INFO: 277/277 source files have been analyzed
> INFO: ------------- Run sensors on project
> INFO: Sensor Zero Coverage Sensor
> INFO: Sensor Zero Coverage Sensor (done) | time=108ms
> INFO: Sensor Java CPD Block Indexer
> INFO: Sensor Java CPD Block Indexer (done) | time=11ms
> INFO: CPD Executor 283 files had no CPD blocks
> INFO: CPD Executor Calculating CPD for 406 files
> INFO: CPD Executor CPD calculation finished (done) | time=105ms
> INFO: Analysis report generated in 388ms, dir size=2 MB
> INFO: Analysis report compressed in 1937ms, zip size=1 MB
> INFO: Analysis report uploaded in 67ms
> INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=FenixGoNative
> INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
> INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AXN8GyF5zYWRg-xjPnW4
> INFO: Analysis total time: 16.702 s
> INFO: ------------------------------------------------------------------------
> INFO: EXECUTION SUCCESS
> INFO: ------------------------------------------------------------------------
> INFO: Total time: 17.542s
> INFO: Final Memory: 18M/74M
> INFO: ------------------------------------------------------------------------
专注分享java语言的经验与见解,让所有开发者获益!
评论