Jenkins 请检查包含/排除模式是否为主文件和测试文件生成不相交集

Jenkins 请检查包含/排除模式是否为主文件和测试文件生成不相交集,jenkins,sonarqube,sonarqube-scan,Jenkins,Sonarqube,Sonarqube Scan,詹金2.289 爪哇11 sonarqube-7.9.1 这里是我的詹金斯使用插件“SonarQube扫描仪”的工作: 您似乎正在使用Maven SonarQube插件的“sonar”目标,因此不应指定“sonar.sources”值。这是由插件完成的。Maven利用pom的知识为SonarQube扫描仪提供参数。与“sonar.java.binaries”类似 一旦您解决了这个问题,您可能会发现您没有得到任何测试覆盖率的确认。我相信您使用的“sonar.jacoco.reportPath”属性

詹金2.289

爪哇11

sonarqube-7.9.1

这里是我的詹金斯使用插件“SonarQube扫描仪”的工作:


您似乎正在使用Maven SonarQube插件的“sonar”目标,因此不应指定“sonar.sources”值。这是由插件完成的。Maven利用pom的知识为SonarQube扫描仪提供参数。与“sonar.java.binaries”类似

一旦您解决了这个问题,您可能会发现您没有得到任何测试覆盖率的确认。我相信您使用的“sonar.jacoco.reportPath”属性已经过时了。你可以先验证一下

# Language
sonar.language=java

#BaseDir
sonar.projectBaseDir=/home/myUser/.jenkins/workspace/my-project-sonar/my-project


# Set modules IDs
sonar.modules=my-project-common,my-project-dalReader,my-project-mediation,my-project-reports,my-project-server,my-project-dal,my-project-dalWriter,my-project-sdn


# Modules inherit properties set at parent level

sonar.sources=./
#sonar.sources=**/src/main/**

#**/src/**

sonar.exclusions=**/generated-sources/**,**/src/test/**,**/*Header.java,./.svn,./my-project-it,./my-project-parent,./my-project-client

# By default, the base directory for a module is <current_dir>/<module_ID>.
common-model.sonar.projectBaseDir=common-model
my-project-common.sonar.projectBaseDir=my-project-common
my-project-sdn.sonar.projectBaseDir=my-project-sdn

sonar.junit.reportsPath=**/target/surefire-reports/*

# Comma-separated paths to directories containing the compiled bytecode files corresponding to your source files
sonar.java.binaries=**/target/classes/**

# Tells SonarQube where the unit tests code coverage report is
sonar.jacoco.reportPath=**/target/jacoco-ut.exec

# Encoding of the source files
sonar.sourceEncoding=UTF-8
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 15.111s
INFO: Final Memory: 13M/550M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: File myproject-server/server-deployment/pom.xml can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
ERROR: SonarQube scanner exited with non-zero code: 2
Finished: FAILURE