This application demonstrate how to configure Sonarqube with gradle for an Android project. Sources are based on a Google sample app.
-
Install Docker
-
Install and run Sonqube Docker image
sonarqube:alpine
:docker run -d -p 9000:9000 -p 9092:9092 sonarqube:alpine
sonarqube:alpine
is a lightweight version (5M) or sonarqube:latest. See docker store page for details.
- Run analysis
./gradlew clean test jacocoTestReport sonarqube \
-Dsonar.host.url=http://[Sonarqube container IP]:9000 \
--info --stacktrace
Replace [Sonarqube container IP]
with corresponding IP address.
-
Watch result here: http://[Sonarqube container IP]:9000
- Log in with default user:
admin/admin
- Warning: analyses is done by a background task and can take a view seconds. You can follow background task here:
Administration > Projects > Background Tasks
- Log in with default user:
-
See Sonarqube logs:
docker logs sonarqube:alpine