1 year ago

#195153

test-img

middlelady

SonarQube index twice error with folder and subfolder

I am making an attempt to create separate dashboards with a folder and a sub-folder of the same project. My configuration file looks like this

sonar:
  projectKey: myproject
  projectName: my project name
  projectVersion: "1.0"
  sourceEncoding: UTF-8
  dynamicAnalysis: reuseReports

  exclusions: &global.exclusions
    ...

  test:
    inclusions:
      ...
    exclusions: &global.test.exclusions
      ...
  # exclude files which are usually untested
  coverage.exclusions:
    ...

  # exclude files which commonly have repeated blocks
  cpd.exclusions: []

  # report paths are injected from the code
  javascript.lcov.reportPaths: &reportPaths []
  typescript.lcov.reportPaths: *reportPaths

  issue.ignore.multicriteria:
    ...

  modules:
    - frontend
    - cms

# modules
frontend.sonar:
  projectName: frontend
  projectBaseDir: .
  sources: &frontend.sources
    - frontend
  tests:
    - *frontend.sources
    - frontend/testutils
  exclusions: &frontend.exclusions
    - 'frontend/cms'
    - 'frontend/cms/**'
    - 'frontend/cms-store'
    - 'frontend/cms-store/**'
    - *global.exclusions

cms.sonar:
  projectName: cms
  projectBaseDir: .
  sources: &cms.sources
    - 'frontend/cms'
    - 'frontend/cms-store'
  tests:
    - *cms.sources
  exclusions:
    - *global.exclusions

The problem is that I am getting the error of

ERROR: File ... be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

I tried to change inclusions and exclusions accordingly, but it doesn't look to work. Any suggestions?

sonarqube

sonarqube-scan

sonar-runner

0 Answers

Your Answer

Accepted video resources