Based on the provided content, here's a summary of how to configure and use the SonarQube Gradle plugin for both single-module and multi-module projects:
Single-Module Project
-
Apply Plugin:
- In
build.gradleorbuild.gradle.kts, apply the SonarQube Gradle plugin.groovy1plugins { 2 id 'org.sonarqube' version '5.1.0.4882' 3}
- In
-
Configure Properties:
- Set up properties for your project in
sonarblock.groovy1sonar { 2 properties { 3 property 'sonar.projectKey', 'com.example:my-project' 4 property 'sonar.projectName', 'My Project' 5 property 'sonar.host.url', 'http://localhost:9000' 6 property 'sonar.java.source', '17' // Example for Java projects 7 } 8}
- Set up properties for your project in
-
Run Analysis:
- Execute Gradle tasks in the correct order.
shell
1./gradlew test jacocoTestReport sonar -Dsonar.token=YOUR_TOKEN
- Execute Gradle tasks in the correct order.
Read the full article at DEV Community
Want to create content about this topic? Use Nemati AI tools to generate articles, social posts, and more.

![[AINews] The Unreasonable Effectiveness of Closing the Loop](/_next/image?url=https%3A%2F%2Fmedia.nemati.ai%2Fmedia%2Fblog%2Fimages%2Farticles%2F600e22851bc7453b.webp&w=3840&q=75)



