Updates to gradle build and sonar plugin. Finally fixing some of the warnings.