Когда SonarQube сканирует проект субмодуля Git, сканируются только файлы суперпроекта. - PullRequest
0 голосов
/ 06 августа 2020

Когда SonarQube сканирует проект подмодуля Git, сканируются только файлы суперпроекта. Беги в Дженкинсе (Linux) Версия SonarQube - 7.9.3 проект maven

супер проект: only 2 file: .gitmodules and pom.xml

in other project,maven project have module,but not use git submodule can work.

the log: only 1 file, the pom.xml for super project are scanned.

[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] SonarQube version: 7.9.3
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
[INFO] Load global settings
[INFO] Load global settings (done) | time=86ms
[INFO] Server id: 0697A0C6-AXLFaD-v57HRhyHJwu5i
[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=55ms
[INFO] Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
[INFO] Load/download plugins (done) | time=83ms
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=5ms
[INFO] Project key: szyh_apps
[INFO] Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO] Working dir: /var/lib/jenkins/workspace/sonar/ **** /target/sonar
[INFO] Load project settings for component key: 'szyh_apps'
[INFO] Load project settings for component key: 'szyh_apps' (done) | time=14ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=51ms
[INFO] Detected Jenkins
[INFO] Load active rules
[INFO] Load active rules (done) | time=567ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] Indexing files of module '******'
[INFO]   Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO]   Source paths: pom.xml, src/main/java
[INFO]   Test paths: src/test/java
...
[INFO] Indexing files of module '****(the aggregator project)****'
[INFO]   Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO]   Source paths: pom.xml
[INFO] 1 file indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module ****
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=16ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] Sensor JavaXmlSensor [java] (done) | time=1ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
[INFO] ------------- Run sensors on module ****
[INFO] Sensor JavaXmlSensor [java]
[INFO] Sensor JavaXmlSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
...
[INFO] Sensor MyBatisLint Sensor [mybatis]
[INFO] stmtIdExcludeList: []
[INFO] Sensor MyBatisLint Sensor [mybatis] (done) | time=78ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=16ms
[INFO] Sensor JavaXmlSensor [java] (done) | time=172ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=13ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=143ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=0ms
[INFO] SCM provider for this project is: git
[INFO] 1 files to be analyzed
[INFO] 1/1 files analyzed
[INFO] Calculating CPD for 0 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 70ms, dir size=191 KB
[INFO] Analysis report compressed in 9ms, zip size=16 KB
[INFO] Analysis report uploaded in 20ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http:// **** /dashboard?id=szyh_apps
[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:// **** /api/ce/task?id=****
[INFO] Analysis total time: 5.244 s
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 

In SonarQube,only pom.xml

disabled scm can work, but no time and author information

mvn jacoco:prepare-agent sonar:sonar \
  -Dsonar.projectKey=szyh_apps \
  -Dsonar.host.url=http://**** \
  -Dsonar.login=**** \
  -Dsonar.scm.disabled \
  -s /usr/share/maven/conf/settings-szyh_apps.xml
...