Hey there.
I think you have to set the SONAR_SCANNER_OPTS variable at the pipeline level, rather than the task.
SONAR_SCANNER_OPTS