Hi everybody,
I want to ignore specific blocks in my code.
I test the sonar.issue.ignore.block, but it’s seems not working. I test with UI configuration, but also with configuration directly in the pom.xml file or in the command line even if it’s not recommended. It never works.
I found two others topics with more or less the same problem but the answers were unclear.
Can I have a clear answer? This option is functional or not?
- ALM used : GitHub
- CI system used : CircleCI
- Scanner command used when applicable (private details masked) :
mvn sonar:sonar -DsourceEncoding=UTF-8 -Dsonar.organization=XXX -Dsonar.projectKey=XXX -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=XXX -Dsonar.branch.name=test -Dsonar.branch.target=develop -Dsonar.project.name=XXX
- Languages of the repository : Java
- Steps to reproduce :
A example of specific blocks to ignore :
UI configuration :
Result :
SonarScanner Context :
Project server settings:
- sonar.branch.longLivedBranches.regex=(master|develop)
- sonar.exclusions=pom.xml
- sonar.issue.ignore.block=1
- sonar.issue.ignore.block.1.beginBlockRegexp=// @SONAR_STOP@
- sonar.issue.ignore.block.1.endBlockRegexp=// @SONAR_START@
- sonar.junit.reportPaths=/target/surefire-reports
- sonar.pullrequest.provider=GitHub
- sonar.scm.disabled=false