I really have an overflow trying to get these things to work together. I followed the instructions from here: http://docs.sonarqube.org/display/PLUG/Android+Lint+Plugin and finally got the SonarQube 5.1.1 server with the Android 1.1 Lint plugin installed. Then I configured my multi-module Gradle construct to work with the SonarQube plugin: see the code snippet from the root config below.
plugins { id 'org.sonarqube' version '1.0' } sonarqube { properties { property 'sonar.host.url', 'sonarqube-server:9000' property 'sonar.jdbc.url', 'jdbc:mysql://sonarqube-db:3306/sonar?useUnicode=true&characterEncoding=utf8' property 'sonar.jdbc.driverClassName', 'com.mysql.jdbc.Driver' property 'sonar.jdbc.username', 'sonar' property 'sonar.jdbc.password', 'sonar' property 'sonar.sourceEncoding', 'UTF-8' property 'sonar.login', 'admin' property 'sonar.password', 'admin' property 'sonar.profile', 'Android Lint' property 'sonar.import_unknown_files', true property 'sonar.android.lint.report', 'build/outputs/lint-results.xml' } }
And after that I completed the lint sonarqube task to do the analysis. As a result, I got a lot of Lint errors regarding the retrolambda project ( java.lang.UnsupportedOperationException: Unknown ASTNode child: LambdaExpression ), which is quite normal, and the lint-results.xml files (along with the HTML version) for each module containing descriptions of the problems found . The report says there were 8 errors and 434 warnings were found. But everything went wrong when the sonarqube plugin tried to upload the results to the SonarQube server. The log was filled with the messages "Could not find file" and "Could not find rule." And when the processing was over, then there was no problem for my project on the SonarQube server.
And I wonder what went wrong? I checked the paths and all the files were there. I looked through all the discussions that I could reach, and it seems that my configuration is correct, and I am all right. Does anyone know what I missed and what needs to be checked? Any suggestions or ideas are welcome.
I will also be glad if there is a way to import lint data using the external SonarQube Runner, as this tool looks more predictable and stable than the Gradle plugin.
java android android-gradle gradle sonarqube
sviklim Aug 12 '15 at 15:23 2015-08-12 15:23
source share