we are using SonarQube Developer Edition version 9.9.1 (build 69595) and sonar-scanner-184.108.40.20656.
I noticed that sonar-scanner downloads a lot of plug-ins when running the first analysis. We are working in a devcontainer, so I would like to move this step of downloading the plug-ins to the build stage of the container. How can I achieve that?
My closest approach by now is this:
export SONAR_HOST_URL=... export SONAR_TOKEN=... /opt/sonar-scanner-220.127.116.1156/bin/sonar-scanner -X | tee >(grep "You must define the following mandatory properties for 'Unknown': sonar.projectKey")
Like this sonar-scanner will download the plug-ins and then emit an error, because the project key is not set. I artificially fix the exit code of the command by grepping for the expected error message. It works, but it is kind of dirty.
Is there a better approach?