From 3639887afad7deb00c051642ea4177aaf9160fb7 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 11 Nov 2022 08:20:44 +0100 Subject: [PATCH] SONAR-17593 Rename gradle task and extension from 'sonarqube' to 'sonar' --- build.gradle | 6 +-- plugins/build.gradle | 2 +- server/build.gradle | 2 +- server/sonar-ce-common/build.gradle | 2 +- .../build.gradle | 2 +- server/sonar-ce-task/build.gradle | 2 +- server/sonar-ce/build.gradle | 2 +- server/sonar-db-core/build.gradle | 2 +- server/sonar-db-dao/build.gradle | 2 +- server/sonar-db-migration/build.gradle | 2 +- server/sonar-docs/build.gradle | 2 +- .../analysis/bitbucket-cloud-integration.md | 4 +- .../src/pages/analysis/github-integration.md | 3 +- .../analysis/scan/sonarscanner-for-gradle.md | 44 +++++++++---------- server/sonar-main/build.gradle | 2 +- server/sonar-process/build.gradle | 2 +- server/sonar-server-common/build.gradle | 2 +- server/sonar-web/build.gradle | 2 +- .../__snapshots__/PreambuleYaml-test.tsx.snap | 2 +- .../__snapshots__/Gradle-test.tsx.snap | 4 +- .../tutorials/gitlabci/ProjectKeyStep.tsx | 2 +- .../ProjectKeyStep-test.tsx.snap | 2 +- .../__snapshots__/Gradle-test.tsx.snap | 2 +- .../src/main/js/components/tutorials/utils.ts | 2 +- server/sonar-webserver-api/build.gradle | 2 +- server/sonar-webserver-auth/build.gradle | 2 +- server/sonar-webserver-core/build.gradle | 2 +- server/sonar-webserver-es/build.gradle | 2 +- server/sonar-webserver-pushapi/build.gradle | 2 +- server/sonar-webserver-webapi/build.gradle | 2 +- server/sonar-webserver-ws/build.gradle | 2 +- server/sonar-webserver/build.gradle | 2 +- sonar-application/build.gradle | 2 +- sonar-check-api/build.gradle | 2 +- sonar-core/build.gradle | 2 +- sonar-duplications/build.gradle | 2 +- sonar-markdown/build.gradle | 2 +- sonar-plugin-api-impl/build.gradle | 2 +- sonar-scanner-engine-shaded/build.gradle | 2 +- sonar-scanner-engine/build.gradle | 2 +- sonar-scanner-protocol/build.gradle | 2 +- sonar-shutdowner/build.gradle | 2 +- sonar-testing-harness/build.gradle | 2 +- sonar-testing-ldap/build.gradle | 2 +- sonar-ws-generator/build.gradle | 2 +- sonar-ws/build.gradle | 2 +- ut-monitoring/build.gradle | 4 +- 47 files changed, 73 insertions(+), 74 deletions(-) diff --git a/build.gradle b/build.gradle index 78dc66d3355..6313a872b1e 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { id "de.undercouch.download" version "5.0.1" apply false id 'io.spring.dependency-management' version '1.0.11.RELEASE' id "org.cyclonedx.bom" version "1.6.1" apply false - id 'org.sonarqube' version '3.4.0.2513' + id 'org.sonarqube' version '3.5.0.2730' } if (!JavaVersion.current().java11Compatible) { @@ -123,7 +123,7 @@ allprojects { } apply plugin: 'org.sonarqube' -sonarqube { +sonar { properties { property 'sonar.projectName', projectTitle property 'sonar.projectVersion', "${versionInSources}-SNAPSHOT" @@ -158,7 +158,7 @@ subprojects { protobufVersion = '3.21.7' } - sonarqube { + sonar { properties { property 'sonar.moduleKey', project.group + ':' + project.name } diff --git a/plugins/build.gradle b/plugins/build.gradle index 6b01df30596..1b5ea2f1517 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -1,3 +1,3 @@ -sonarqube { +sonar { skipProject = true } diff --git a/server/build.gradle b/server/build.gradle index 49d6218996b..2a4d3600a04 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Server :: Parent" } diff --git a/server/sonar-ce-common/build.gradle b/server/sonar-ce-common/build.gradle index f02fe38e611..207e2e46ad2 100644 --- a/server/sonar-ce-common/build.gradle +++ b/server/sonar-ce-common/build.gradle @@ -1,6 +1,6 @@ description = 'Code relating to the Compute Engine shared between the Compute Engine and the Web Server' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Compute Engine :: Common" } diff --git a/server/sonar-ce-task-projectanalysis/build.gradle b/server/sonar-ce-task-projectanalysis/build.gradle index 78d04b04452..5ad68e98bde 100644 --- a/server/sonar-ce-task-projectanalysis/build.gradle +++ b/server/sonar-ce-task-projectanalysis/build.gradle @@ -1,6 +1,6 @@ description = 'Code of the Compute Engine task processing project analysis reports' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Compute Engine :: Task :: Project Analysis" } diff --git a/server/sonar-ce-task/build.gradle b/server/sonar-ce-task/build.gradle index 5bbea313583..1dd4ec7f979 100644 --- a/server/sonar-ce-task/build.gradle +++ b/server/sonar-ce-task/build.gradle @@ -1,6 +1,6 @@ description = 'Definition of a Compute Engine task and utility "framework" and classes to code one' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Compute Engine :: Task" } diff --git a/server/sonar-ce/build.gradle b/server/sonar-ce/build.gradle index f66a080cfa7..75db8ee6fd7 100644 --- a/server/sonar-ce/build.gradle +++ b/server/sonar-ce/build.gradle @@ -1,6 +1,6 @@ description = 'Compute Engine JVM application' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Compute Engine" } diff --git a/server/sonar-db-core/build.gradle b/server/sonar-db-core/build.gradle index c37d4764667..845e2e645e5 100644 --- a/server/sonar-db-core/build.gradle +++ b/server/sonar-db-core/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Database Core" } diff --git a/server/sonar-db-dao/build.gradle b/server/sonar-db-dao/build.gradle index eecd0a08593..59a2bf70848 100644 --- a/server/sonar-db-dao/build.gradle +++ b/server/sonar-db-dao/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: DAO" } diff --git a/server/sonar-db-migration/build.gradle b/server/sonar-db-migration/build.gradle index 1cb23f4fdce..c19929c27af 100644 --- a/server/sonar-db-migration/build.gradle +++ b/server/sonar-db-migration/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Database Migration" } diff --git a/server/sonar-docs/build.gradle b/server/sonar-docs/build.gradle index 0564c46e096..0315080a708 100644 --- a/server/sonar-docs/build.gradle +++ b/server/sonar-docs/build.gradle @@ -8,7 +8,7 @@ Pattern PLUGIN_NAME_PATTERN = Pattern.compile("(sonar-.*-plugin)(.*)") * This module is building the zip file containing the static web site */ -sonarqube { +sonar { skipProject = true } diff --git a/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md b/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md index da79548b30e..46a7fa1aaf4 100644 --- a/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md +++ b/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md @@ -104,7 +104,7 @@ Click the scanner you're using below to expand the example configuration: | - gradle | - sonar | script: -| - bash ./gradlew sonarqube +| - bash ./gradlew sonar | caches: | sonar: ~/.sonar | @@ -301,4 +301,4 @@ SonarQube can also report your Quality Gate status to Bitbucket Cloud pull reque ## Authenticating with Bitbucket Cloud -See [Authenticating with Bitbucket Cloud](/instance-administration/authentication/bitbucket-cloud/) \ No newline at end of file +See [Authenticating with Bitbucket Cloud](/instance-administration/authentication/bitbucket-cloud/) diff --git a/server/sonar-docs/src/pages/analysis/github-integration.md b/server/sonar-docs/src/pages/analysis/github-integration.md index aeb67379c20..a4db3276b99 100644 --- a/server/sonar-docs/src/pages/analysis/github-integration.md +++ b/server/sonar-docs/src/pages/analysis/github-integration.md @@ -216,7 +216,7 @@ Click the scanner you're using below to expand the example configuration: | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} -| run: ./gradlew build sonarqube --info +| run: ./gradlew build sonar --info | ``` @@ -416,4 +416,3 @@ Initially, all issues marked **Open** on SonarQube are marked **Open** on GitHub |Dismiss: Used in tests|Resolve (Won't Fix)| |Dismiss: Won't fix|Resolve (Won't Fix)| - \ No newline at end of file diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md index f091c68970a..90e0a2fb88c 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md @@ -11,9 +11,9 @@ url: /analysis/scan/sonarscanner-for-gradle/ | See the [online documentation](https://redirect.sonarsource.com/doc/download-scanner-gradle.html) to get more details on the latest version of the scanner and how to download it. -The SonarScanner for Gradle provides an easy way to start SonarQube analysis of a Gradle project. +The SonarScanner for Gradle provides an easy way to start the scan of a Gradle project. -The ability to execute the SonarQube 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 SonarQube Runner installation. The Gradle build already has much of the information needed for SonarQube to successfully analyze a project. By preconfiguring the analysis based on that information, the need for manual configuration is reduced significantly. +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 Gradle build already has much of the information needed for the SonarScanner to successfully analyze a project. By preconfiguring the analysis based on that information, the need for manual configuration is reduced significantly. ## Prerequisites * Gradle versions 5+ @@ -42,14 +42,14 @@ Ensure that you declare the plugins in the correct sequence required by Gradle, Assuming a local SonarQube server with out-of-the-box settings is up and running, no further configuration is required. -You need to pass an [authentication token](/user-guide/user-token/) using the `sonar.login` property in your command line or you configure it as part of your `gradle.properties` file. Execute `gradle sonarqube -Dsonar.login=yourAuthenticationToken` and wait until the build has completed, then open the web page indicated at the bottom of the console output. You should now be able to browse the analysis results. +You need to pass an [authentication token](/user-guide/user-token/) using the `sonar.login` property in your command line or you configure it as part of your `gradle.properties` file. Execute `gradle sonar -Dsonar.login=yourAuthenticationToken` and wait until the build has completed, then open the web page indicated at the bottom of the console output. You should now be able to browse the analysis results. ## Analyzing Multi-Project Builds -To analyze a project hierarchy, apply the SonarQube plugin to the root project of the hierarchy. Typically (but not necessarily) this will be the root project of the Gradle build. Information pertaining to the analysis as a whole has to be configured in the sonarqube block of this project. Any properties set on the command line also apply to this project. +To analyze a project hierarchy, apply the SonarQube plugin to the root project of the hierarchy. Typically (but not necessarily) this will be the root project of the Gradle build. Information pertaining to the analysis as a whole has to be configured in the sonar block of this project. Any properties set on the command line also apply to this project. ``` // build.gradle -sonarqube { +sonar { properties { property "sonar.sourceEncoding", "UTF-8" } @@ -60,7 +60,7 @@ Configuration shared between subprojects can be configured in a subprojects bloc ``` // build.gradle subprojects { - sonarqube { + sonar { properties { property "sonar.sources", "src" } @@ -68,35 +68,35 @@ subprojects { } ``` -Project-specific information is configured in the `sonarqube` block of the corresponding project. +Project-specific information is configured in the `sonar` block of the corresponding project. ``` // build.gradle project(":project1") { - sonarqube { + sonar { properties { property "sonar.branch", "Foo" } }} ``` -To skip SonarQube analysis for a particular subproject, set sonarqube.skipProject to true. +To skip SonarScanner analysis for a particular subproject, set sonar.skipProject to true. ``` // build.gradle project(":project2") { - sonarqube { + sonar { skipProject = true } } ``` ## Task dependencies -All tasks that produce output that should be included in the SonarQube analysis need to be executed before the `sonarqube` task runs. Typically, these are compile tasks, test tasks, and [code coverage](/analysis/coverage/) tasks. +All tasks that produce output that should be included in the SonarScanner analysis need to be executed before the `sonar` task runs. Typically, these are compile tasks, test tasks, and [code coverage](/analysis/coverage/) tasks. Starting with v3.0 of the SonarScanner for Gradle, task dependencies are no longer added automatically. Instead, the SonarScanner plugin enforces the correct order of tasks with `mustRunAfter`. You need to be either manually run the tasks that produce output before `sonarqube`, or you can add a dependency to the build script: ``` // build.gradle -project.tasks["sonarqube"].dependsOn "anotherTask" +project.tasks["sonar"].dependsOn "anotherTask" ``` ## Sample project @@ -107,7 +107,7 @@ https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-sca ## Analysis property defaults The SonarScanner for Gradle uses information contained in Gradle's object model to provide smart defaults for most of the standard [analysis parameters](/analysis/analysis-parameters/), as listed below. -Gradle defaults for standard SonarQube properties: +Gradle defaults for standard Sonar properties: Property|Gradle default ---|--- @@ -152,7 +152,7 @@ By default the first variant of type "debug" will be used to configure the analy ``` build.gradle -sonarqube { +sonar { androidVariant 'fullDebug' } ``` @@ -168,23 +168,23 @@ Property| Gradle default ## Passing manual properties / overriding defaults -The SonarScanner for Gradle adds a SonarQubeExtension extension to project and its subprojects, which allows you to configure/override the analysis properties. +The SonarScanner for Gradle adds a SonarExtension extension to project and its subprojects, which allows you to configure/override the analysis properties. ``` // in build.gradle -sonarqube { +sonar { properties { property "sonar.exclusions", "**/*Generated.java" } } ``` -SonarQube properties can also be set from the command line, or by setting a system property named exactly like the SonarQube property in question. This can be useful when dealing with sensitive information (e.g. credentials), environment information, or for ad-hoc configuration. +Sonar properties can also be set from the command line, or by setting a system property named exactly like the Sonar property in question. This can be useful when dealing with sensitive information (e.g. credentials), environment information, or for ad-hoc configuration. ``` -gradle sonarqube -Dsonar.host.url=http://sonar.mycompany.com -Dsonar.verbose=true +gradle sonar -Dsonar.host.url=http://sonar.mycompany.com -Dsonar.verbose=true ``` While certainly useful at times, we recommend keeping the bulk of the configuration in a (versioned) build script, readily available to everyone. -A SonarQube property value set via a system property overrides any value set in a build script (for the same property). When analyzing a project hierarchy, values set via system properties apply to the root project of the analyzed hierarchy. Each system property starting with `sonar.` will be taken into account. +A Sonar property value set via a system property overrides any value set in a build script (for the same property). When analyzing a project hierarchy, values set via system properties apply to the root project of the analyzed hierarchy. Each system property starting with `sonar.` will be taken into account. @@ -193,7 +193,7 @@ By default, the SonarScanner for Gradle passes on the project's main source set ``` // build.gradle -sonarqube { +sonar { properties { properties["sonar.sources"] += sourceSets.custom.allSource.srcDirs properties["sonar.tests"] += sourceSets.integTest.allSource.srcDirs @@ -202,8 +202,8 @@ sonarqube { ``` ## Advanced topics -### More on configuring SonarQube properties -Let's take a closer look at the `sonarqube.properties` `{}` block. As we have already seen in the examples, the `property()` method allows you to set new properties or override existing ones. Furthermore, all properties that have been configured up to this point, including all properties preconfigured by Gradle, are available via the properties accessor. +### More on configuring Sonar properties +Let's take a closer look at the `sonar.properties` `{}` block. As we have already seen in the examples, the `property()` method allows you to set new properties or override existing ones. Furthermore, all properties that have been configured up to this point, including all properties preconfigured by Gradle, are available via the properties accessor. Entries in the properties map can be read and written with the usual Groovy syntax. To facilitate their manipulation, values still have their “idiomatic” type (File, List, etc.). After the sonarProperties block has been evaluated, values are converted to Strings as follows: Collection values are (recursively) converted to comma-separated Strings, and all other values are converted by calling their `toString()` methods. diff --git a/server/sonar-main/build.gradle b/server/sonar-main/build.gradle index 4f6590b8518..a5679c57687 100644 --- a/server/sonar-main/build.gradle +++ b/server/sonar-main/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Main Process" } diff --git a/server/sonar-process/build.gradle b/server/sonar-process/build.gradle index fcdce73fbf0..0ac0583073f 100644 --- a/server/sonar-process/build.gradle +++ b/server/sonar-process/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Process" } diff --git a/server/sonar-server-common/build.gradle b/server/sonar-server-common/build.gradle index 71e74568cfd..4591dcd9bfc 100644 --- a/server/sonar-server-common/build.gradle +++ b/server/sonar-server-common/build.gradle @@ -1,6 +1,6 @@ description = 'Code shared between the Web Server and the Compute Engine' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Server :: Common" } diff --git a/server/sonar-web/build.gradle b/server/sonar-web/build.gradle index 2d019b148f6..320e9eb6f67 100644 --- a/server/sonar-web/build.gradle +++ b/server/sonar-web/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property "sonar.projectName", "${projectTitle} :: Web" property "sonar.sources", "src/main/js" diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap index 17dd4599905..658a4d8e1c5 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap @@ -61,7 +61,7 @@ exports[`should render correctly for gradle 1`] = ` id \\"org.sonarqube\\" version \\"3.5.0.2730\\" } -sonarqube { +sonar { properties { property \\"sonar.projectKey\\", \\"my-project\\" } diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap index 4259dfdb12d..08060e05dfa 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap @@ -33,7 +33,7 @@ exports[`should render correctly 1`] = ` id \\"org.sonarqube\\" version \\"3.5.0.2730\\" } -sonarqube { +sonar { properties { property \\"sonar.projectKey\\", \\"my-project\\" } @@ -121,7 +121,7 @@ exports[`should render correctly: without branch enabled 1`] = ` id \\"org.sonarqube\\" version \\"3.5.0.2730\\" } -sonarqube { +sonar { properties { property \\"sonar.projectKey\\", \\"my-project\\" } diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx index ad6bbbab042..80268bc0ebd 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx @@ -49,7 +49,7 @@ const gradleSnippet = (key: string) => `plugins { id "org.sonarqube" version "${GRADLE_SCANNER_VERSION}" } -sonarqube { +sonar { properties { property "sonar.projectKey", "${key}" property "sonar.qualitygate.wait", true diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/ProjectKeyStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/ProjectKeyStep-test.tsx.snap index d1cc4389e27..ac40253b2df 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/ProjectKeyStep-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/ProjectKeyStep-test.tsx.snap @@ -148,7 +148,7 @@ exports[`should render correctly for build tool gradle 1`] = ` id \\"org.sonarqube\\" version \\"3.5.0.2730\\" } -sonarqube { +sonar { properties { property \\"sonar.projectKey\\", \\"my-project\\" property \\"sonar.qualitygate.wait\\", true diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap index c35c96fbba7..a6458f4cf17 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap @@ -14,7 +14,7 @@ exports[`should render correctly 1`] = ` id \\"org.sonarqube\\" version \\"3.5.0.2730\\" } -sonarqube { +sonar { properties { property \\"sonar.projectKey\\", \\"my-project\\" } diff --git a/server/sonar-web/src/main/js/components/tutorials/utils.ts b/server/sonar-web/src/main/js/components/tutorials/utils.ts index 36a4ec685cf..3b7cefd926e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/utils.ts +++ b/server/sonar-web/src/main/js/components/tutorials/utils.ts @@ -31,7 +31,7 @@ export function buildGradleSnippet(key: string) { id "org.sonarqube" version "${GRADLE_SCANNER_VERSION}" } -sonarqube { +sonar { properties { property "sonar.projectKey", "${key}" } diff --git a/server/sonar-webserver-api/build.gradle b/server/sonar-webserver-api/build.gradle index baa5b8aa75a..872a3d14fd4 100644 --- a/server/sonar-webserver-api/build.gradle +++ b/server/sonar-webserver-api/build.gradle @@ -1,6 +1,6 @@ description = 'SonarQube WebServer internal APIs, used by other Web Server modules or Core Extensions' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: API" } diff --git a/server/sonar-webserver-auth/build.gradle b/server/sonar-webserver-auth/build.gradle index d12c870ed9c..4c981061e48 100644 --- a/server/sonar-webserver-auth/build.gradle +++ b/server/sonar-webserver-auth/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: Authentification and Identity" } diff --git a/server/sonar-webserver-core/build.gradle b/server/sonar-webserver-core/build.gradle index 6443e5c4524..da0a48c0892 100644 --- a/server/sonar-webserver-core/build.gradle +++ b/server/sonar-webserver-core/build.gradle @@ -1,6 +1,6 @@ description = 'SonarQube WebServer-only code' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Web Server :: Core" } diff --git a/server/sonar-webserver-es/build.gradle b/server/sonar-webserver-es/build.gradle index dd127fd35c3..8acb0712834 100644 --- a/server/sonar-webserver-es/build.gradle +++ b/server/sonar-webserver-es/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: ES" } diff --git a/server/sonar-webserver-pushapi/build.gradle b/server/sonar-webserver-pushapi/build.gradle index c7549d06ba5..de2feba9561 100644 --- a/server/sonar-webserver-pushapi/build.gradle +++ b/server/sonar-webserver-pushapi/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: PushAPI" } diff --git a/server/sonar-webserver-webapi/build.gradle b/server/sonar-webserver-webapi/build.gradle index 77956eacc4e..9ffdc194cc1 100644 --- a/server/sonar-webserver-webapi/build.gradle +++ b/server/sonar-webserver-webapi/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: WebAPI" } diff --git a/server/sonar-webserver-ws/build.gradle b/server/sonar-webserver-ws/build.gradle index 535d1036e5f..893e1b0a2a0 100644 --- a/server/sonar-webserver-ws/build.gradle +++ b/server/sonar-webserver-ws/build.gradle @@ -1,6 +1,6 @@ description = 'WebServer "API" to write Web Services' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer :: WS" } diff --git a/server/sonar-webserver/build.gradle b/server/sonar-webserver/build.gradle index 468b3f4fba5..76728cefc98 100644 --- a/server/sonar-webserver/build.gradle +++ b/server/sonar-webserver/build.gradle @@ -1,6 +1,6 @@ description = 'SonarQube WebServer executable and Tomcat directly related code' -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: WebServer" } diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index 60c220f8816..d9da90d312c 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -9,7 +9,7 @@ plugins { id "org.cyclonedx.bom" } -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Application" } diff --git a/sonar-check-api/build.gradle b/sonar-check-api/build.gradle index 48e230f1617..52523a86fe3 100644 --- a/sonar-check-api/build.gradle +++ b/sonar-check-api/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Check API" } diff --git a/sonar-core/build.gradle b/sonar-core/build.gradle index 43dabb80cb4..ceacea76e64 100644 --- a/sonar-core/build.gradle +++ b/sonar-core/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Core" } diff --git a/sonar-duplications/build.gradle b/sonar-duplications/build.gradle index 9a457d2f30e..f7dc1d6b20f 100644 --- a/sonar-duplications/build.gradle +++ b/sonar-duplications/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Duplications" } diff --git a/sonar-markdown/build.gradle b/sonar-markdown/build.gradle index 16e8e834cdc..051ba589705 100644 --- a/sonar-markdown/build.gradle +++ b/sonar-markdown/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Markdown" } diff --git a/sonar-plugin-api-impl/build.gradle b/sonar-plugin-api-impl/build.gradle index 553e644268d..5c69debac0f 100644 --- a/sonar-plugin-api-impl/build.gradle +++ b/sonar-plugin-api-impl/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Plugin API Implementation" } diff --git a/sonar-scanner-engine-shaded/build.gradle b/sonar-scanner-engine-shaded/build.gradle index 9d32f9d396c..dbcf0d5ecc7 100644 --- a/sonar-scanner-engine-shaded/build.gradle +++ b/sonar-scanner-engine-shaded/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Scanner Engine Shaded" } diff --git a/sonar-scanner-engine/build.gradle b/sonar-scanner-engine/build.gradle index 62841af3c82..16c4a55e3e3 100644 --- a/sonar-scanner-engine/build.gradle +++ b/sonar-scanner-engine/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Scanner Engine" } diff --git a/sonar-scanner-protocol/build.gradle b/sonar-scanner-protocol/build.gradle index b1e3e04f859..aa7252a787a 100644 --- a/sonar-scanner-protocol/build.gradle +++ b/sonar-scanner-protocol/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Scanner :: Protocol" property 'sonar.exclusions', 'src/main/java/org/sonar/scanner/protocol/viewer/**' diff --git a/sonar-shutdowner/build.gradle b/sonar-shutdowner/build.gradle index f0260c1cd75..1855e99fe6c 100644 --- a/sonar-shutdowner/build.gradle +++ b/sonar-shutdowner/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Shutdowner" } diff --git a/sonar-testing-harness/build.gradle b/sonar-testing-harness/build.gradle index 254b98f311a..40c523c8bdb 100644 --- a/sonar-testing-harness/build.gradle +++ b/sonar-testing-harness/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Testing Harness" } diff --git a/sonar-testing-ldap/build.gradle b/sonar-testing-ldap/build.gradle index 8f82987689f..ef4b246bbf5 100644 --- a/sonar-testing-ldap/build.gradle +++ b/sonar-testing-ldap/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: LDAP Testing" } diff --git a/sonar-ws-generator/build.gradle b/sonar-ws-generator/build.gradle index 902dcf153d0..d2b875cd52c 100644 --- a/sonar-ws-generator/build.gradle +++ b/sonar-ws-generator/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { skipProject = true } diff --git a/sonar-ws/build.gradle b/sonar-ws/build.gradle index a01d386e89d..40ecc959ab8 100644 --- a/sonar-ws/build.gradle +++ b/sonar-ws/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Web Service" property 'sonar.exclusions', 'src/main/java/org/sonarqube/ws/client/*/*.java' diff --git a/ut-monitoring/build.gradle b/ut-monitoring/build.gradle index 173f087ba59..ee096d95cf8 100644 --- a/ut-monitoring/build.gradle +++ b/ut-monitoring/build.gradle @@ -1,4 +1,4 @@ -sonarqube { +sonar { properties { property 'sonar.projectName', "${projectTitle} :: Java UT Monitoring" } @@ -14,6 +14,6 @@ dependencies { compileOnly 'org.aspectj:aspectjtools' } -sonarqube { +sonar { skipProject = true } -- 2.39.5