Complete guide to build the creedengo-android project and deploy the plugin to a local SonarQube instance via Docker.
- Java 11 (JDK) — required by the project
- Maven 3.8+
- Gradle 6.9.2 — needed to build CodeNarc
- Docker and Docker Compose
Verify installations:
java -version # should display 11.x
mvn -version
gradle -version # 6.9.2
docker --version
docker compose versionThe Android plugin uses CodeNarc to analyze Gradle files. It must be built separately and installed in the local Maven repository.
# From the project root
./tool_prepare-codenarc.shThis script does two things:
- Builds CodeNarc (in
codenarc-converter/CodeNarc/) via Gradle - Installs the resulting JAR into the local Maven repository (
~/.m2/repository)
Common issue: if Gradle uses the wrong Java version, force it with
export JAVA_HOME=$(/usr/libexec/java_home -v 11)before running the script. Ideally, use sdkman to manage Java versions.
# From the project root
./tool_build.shOr manually:
mvn clean package -DskipTestsThe plugin JAR is generated at:
android-plugin/target/creedengo-android-2.0.0-SNAPSHOT.jar
It is also automatically copied to ./lib/ by the Maven build.
mvn clean verifyThe android-plugin/docker-compose.yml file is preconfigured to mount the plugin JAR directly into SonarQube.
Important: The Docker image version must be compatible with the
sonarqube.versiondeclared in the rootpom.xml. If SonarQube rejects the plugin at startup, check the logs (docker compose logs sonar) for an API version mismatch.
cd android-plugin
docker compose up -dThis starts:
- SonarQube Community Edition on port
9000 - PostgreSQL 12 as the database
The plugin is mounted via a bind mount:
./target/creedengo-android-2.0.0-SNAPSHOT.jar → /opt/sonarqube/extensions/plugins/
docker compose logs -f sonarWait for the SonarQube is operational message (may take 1-2 minutes).
- Open http://localhost:9000
- Log in with default credentials: admin / admin
- SonarQube will ask to change the password on first login
Go to Administration → Marketplace → Installed (or Administration → Plugins).
The "Creedengo Android Java plugin" should appear in the list.
You can also check available rules:
- Rules → Repository: search for "creedengo" to see the plugin's rules
To run an analysis on a local Android project:
cd /path/to/your/android-project
mvn sonar:sonar \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=admin \
-Dsonar.password=your_new_passwordOr with a token (recommended):
# Generate a token in SonarQube: My Account → Security → Generate Tokens
mvn sonar:sonar \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.token=squ_xxxxxxxxxxxxxWhen you modify the plugin and want to test changes:
# 1. Rebuild the plugin
cd /path/to/creedengo-android
mvn clean package -DskipTests
# 2. Restart SonarQube to load the new JAR
cd android-plugin
docker compose restart sonar
# 3. Wait for SonarQube to be operational, then re-run the analysiscd android-plugin
# Stop containers (data is preserved in volumes)
docker compose down
# Stop AND remove volumes (full reset)
docker compose down -v| Problem | Solution |
|---|---|
Permission denied on .sh scripts |
chmod +x tool_*.sh |
| SonarQube won't start (Elasticsearch) | Increase vm.max_map_count: sudo sysctl -w vm.max_map_count=262144 |
| Plugin not visible after restart | Check that the JAR exists in android-plugin/target/ and that the name matches the bind mount in docker-compose.yml |
| Plugin rejected (API version mismatch) | Update the Docker image version to match sonarqube.version in pom.xml |
| CodeNarc compilation error | Verify that JAVA_HOME points to Java 11 |
| Port 9000 already in use | Find what's using it: lsof -i :9000, then either stop it or change the port in docker-compose.yml to e.g. "9001:9000" |
OutOfMemoryError during Maven build |
export MAVEN_OPTS="-Xmx1024m" |