

Furthermore, all properties that have been configured up to this point, including all properties preconfigured by Gradle, are available via the properties accessor.Įntries in the properties map can be read and written with the usual Groovy syntax. As we have already seen in the examples, the property method allows you to set new properties or override existing ones. Let's take a closer look at the sonar.properties block.

In that case, apply the SonarQube plugin dependency to your file below: plugins Advanced topics More on configuring SonarQube properties Kotlin DSL is now the default choice for new Gradle builds. # gradle.propertiesįirst, you need to activate the scanner in your build. Be aware that the scanner uses system properties so all properties should be prefixed by systemProp. A good place to configure global properties is ~/.gradle/gradle.properties. Installation is automatic, but certain global properties should still be configured. Gradle 7+ and AGP 7+ for Android projectsīytecode created by javac compilation is required for Java analysis, including Android projects.By preconfiguring the analysis based on that information, the need for manual configuration is reduced significantly. The Gradle build already has much of the information needed for the SonarScanner to successfully analyze a project. The ability to execute the SonarScanner analysis via a regular Gradle task makes it available anywhere Gradle is available (developer build, CI server, etc.), without the need to manually download, setup, and maintain a SonarScanner CLI installation. The SonarScanner for Gradle provides an easy way to start the scan of a Gradle project.
