Thank you for explaining the plugin you are using. That is not an official Sonar scanner plugin we created so I cannot testify to its capabilities but I can tell so far that it is not optimized for your build since it’s leveraging the Sonar scanner CLI and not Sonar scanner Maven.
Try using Sonar scanner for Maven locally and you’ll see how much easier it is since you don’t have to specify
sonar.java.libraries etc. Once you updated your pipeline on TeamCity, you won’t need to use the TeamCity Sonar runner plugin; you can just call
mvn clean verify sonar:sonar, for example.