Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java SonarQube可以';t分析我的Kotlin多平台模块 处境_Java_Android_Kotlin_Sonarqube_Kotlin Multiplatform - Fatal编程技术网

Java SonarQube可以';t分析我的Kotlin多平台模块 处境

Java SonarQube可以';t分析我的Kotlin多平台模块 处境,java,android,kotlin,sonarqube,kotlin-multiplatform,Java,Android,Kotlin,Sonarqube,Kotlin Multiplatform,我们有一个项目,有很多模块(java和android)。我们还有一个附加模块,即Kotlin多平台模块。我们在iOS应用程序中重用此模块中的代码。 我们的长期目标是将更多代码从现有模块转移到Kotlin多平台模块,以共享我们的核心业务逻辑。 我们使用SonarQube进行静态代码分析。我们有自己的实例,版本7.9.3 LTS。为了扫描我们的项目,我们使用SonarQube Gradle插件。此外,我们还有Jacoco用于代码覆盖 问题TL;博士 
扫描我们的项目时,SonarQube扫描仪进入我

我们有一个项目,有很多模块(java和android)。我们还有一个附加模块,即Kotlin多平台模块。我们在iOS应用程序中重用此模块中的代码。 我们的长期目标是将更多代码从现有模块转移到Kotlin多平台模块,以共享我们的核心业务逻辑。 我们使用SonarQube进行静态代码分析。我们有自己的实例,版本7.9.3 LTS。为了扫描我们的项目,我们使用SonarQube Gradle插件。此外,我们还有Jacoco用于代码覆盖

问题TL;博士 
扫描我们的项目时,SonarQube扫描仪进入我们的Kotlin多平台模块,但找不到任何来源。简单地说,它没有找到任何来源,并移动到下一个模块。我们已经在sonar source社区网站上发布了一个问题,但没有得到任何回应:



详细问题
  • 要运行SonarQube,我们使用:
    
./gradlew JacoTestReport sonarqube--信息
  • 在日志中,我可以看到运行此命令会导致SonarQube在项目的每个模块中运行不同的传感器。例如,对于其中一个Java模块,日志如下所示:

  • 正如您所看到的,在Java模块上,它运行了我们安装的所有插件。

但当扫描仪进入Kotlin多平台模块时,不会发生这种情况:
  • 


奇怪的是,它运行了一些传感器,但不是全部,它没有运行Kotlin和Detekt传感器。这就是为什么它没有找到任何要扫描的源。

在过去的几个月里,我花了几天时间尝试该模块的不同SonarQube配置。我用不同的变体为它设置了所有可能的SonarQube属性。它总是一样的,扫描器可以检测模块,但进入模块后,它永远不会运行Kotlin sensor,并且在里面找不到任何Kotlin类

    我们的Kotlin多平台项目是默认项目,我们有以下源代码集:

    • 普通人
    • 普通测试
    • 伊斯曼
    • 失败的
    • jvmMain
    • JVM测试
    ------------- Run sensors on module [OUR JAVA MODULE]
    Delphi Project Helper creation!!!
    No exclude directories found in project configuration.
    Delphi sensor DelphiSensor...
    Delphi Project Helper creation!!!
    No exclude directories found in project configuration.
    Delphi sensor describe...
    SurefireSensor sensor describe...
    PMD sensor.describe
    Sensor JavaSquidSensor [java]
    Configured Java source version (sonar.java.source): 8
    JavaClasspath initialization
    JavaClasspath initialization (done) | time=1ms
    JavaTestClasspath initialization
    JavaTestClasspath initialization (done) | time=22ms
    Java Main Files AST scan
    1003 source files to be analyzed
    
    527/1003 files analyzed, current file: [...]
    789/1003 files analyzed, current file: [...]
    1003/1003 source files have been analyzed
    
    Java Main Files AST scan (done) | time=29234ms
    Java Test Files AST scan
    250 source files to be analyzed
    
    250/250 source files have been analyzed
    
    Java Test Files AST scan (done) | time=5492ms
    Sensor JavaSquidSensor [java] (done) | time=34763ms
    Sensor SurefireSensor [java]
    parsing [.../build/test-results/test]
    Sensor SurefireSensor [java] (done) | time=202ms
    Sensor JaCoCoSensor [java]
    Both 'sonar.jacoco.reportPath' and 'sonar.coverage.jacoco.xmlReportPaths' were set. 'sonar.jacoco.reportPath' is deprecated therefore, only 'sonar.coverage.jacoco.xmlReportPaths' will be taken into account.
    Both 'sonar.jacoco.reportPaths' and 'sonar.coverage.jacoco.xmlReportPaths' were set. 'sonar.jacoco.reportPaths' is deprecated therefore, only 'sonar.coverage.jacoco.xmlReportPaths' will be taken into account.
    Sensor JaCoCoSensor [java] (done) | time=0ms
    Sensor JavaXmlSensor [java]
    Sensor JavaXmlSensor [java] (done) | time=6ms
    Sensor HTML [web]
    Sensor HTML [web] (done) | time=2ms
    Sensor CheckstyleSensor [checkstyle]
    Checkstyle output report: .../checkstyle-result.xml
    Checkstyle configuration: .../checkstyle.xml
    Checkstyle charset: UTF-8
    Sensor CheckstyleSensor [checkstyle] (done) | time=3392ms
    Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor
    Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor (done) | time=1ms
    Sensor JaCoCo XML Report Importer [jacoco]
    Sensor JaCoCo XML Report Importer [jacoco] (done) | time=245ms
    Sensor Kotlin Sensor [kotlin]
    42 source files to be analyzed
    Sensor Kotlin Sensor [kotlin] (done) | time=180ms
    Sensor DetektSensor [detekt]
    
    42/42 source files have been analyzed
    13/13 source files have been analyzed
    2/2 source files have been analyzed
    0/0 source files have been analyzed
    
    RuleSet: complexity - 6
    RuleSet: empty-blocks - 4
    RuleSet: formatting - 104
    RuleSet: naming - 1
    RuleSet: style - 50
    Sensor DetektSensor [detekt] (done) | time=1203ms
    
    

------------- Run sensors on module [OUR KOTLIN MULTIPLATFORM MODULE]
    Delphi Project Helper creation!!!
    No exclude directories found in project configuration.
    Delphi sensor DelphiSensor...
    Delphi Project Helper creation!!!
    No exclude directories found in project configuration.
    Delphi sensor describe...
    SurefireSensor sensor describe...
    PMD sensor.describe
    Sensor JavaXmlSensor [java]
    Sensor JavaXmlSensor [java] (done) | time=0ms
    Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor
    Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor (done) | time=1ms
    Sensor JaCoCo XML Report Importer [jacoco]
    Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms