Sonar exclusion not excluding a python file

I have a src directory which contains a main.py file which has just print(“Hello World”) in it. When those code is going to sonar, it says code coverage is less than 50%.

So, I tried to exclude this file:

sonarDetails:
sourcesPath: “src”
additionalProperties: “-Dsonar.coverage.exclusions=**/src/main.py”

But now the logs say, coverage is “0”.
I also tried changing the code inside the main.py file but it didn’t work. I tried */src/ also, same issue.
What Can be the error?

Hello @saurav-bhagat,

Welcome to the community.

Generally speaking you should provide more iputs for your problems to be sorted out quickly. It seems that there’s a lot you’re not telling me here. You seem to discuss a coverage problem but you don’t explain how you produce the coverage, not what are the files (except main.py) that are involved in the project.
Can you confirm that you do all it takes to produce code coverage ? Can you describe that process ?
Do you import code coverage with the property described on this page ?

Olivier