Plug-in configurations
Manage Jenkins --> Configure System --> SonarQube servers
- Name: Sonar (fixed)
- - Server URL: https://sonar.server.org/
- - Server authentication token: none
+ - Server URL: https://sonar.server.org/ or https://sonarcloud.io
+ - Server authentication token: none for local, API token (saved as a
+ "secret text" credential) for Sonarcloud
Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
- Name: SonarQube Scanner (fixed)
- Install automatically
- Select latest version
+.. note:: Sonar properties can be set directly in the job definition by
+ setting the sonar-project-file to ``""`` and adding all properties under
+ ``sonar-properties``.
+
:Template Names:
- {project-name}-sonar
:Optional Parameters:
:sonar-task: Sonar task to run. (default: "")
+ :sonar-project-file: The filename for the project's properties
+ (default: "sonar-project.properties")
:sonar-properties: Sonar configuration properties. (default: "")
:sonar-java-opts: JVM options. (default: "")
:sonar-additional-args: Additional command line arguments. (default: "")
:Optional Parameters:
:sonar-task: Sonar task to run. (default: "")
+ :sonar-project-file: The filename for the project's properties
+ (default: "sonar-project.properties")
:sonar-properties: Sonar configuration properties. (default: "")
:sonar-java-opts: JVM options. (default: "")
:sonar-additional-args: Additional command line arguments. (default: "")
Requires ``SonarQube Scanner for Jenkins``
+.. note:: Sonar properties can be set directly in the job definition by
+ setting the sonar-project-file to ``""`` and adding all properties under
+ ``sonar-properties``.
+
:Optional Parameters:
:sonar-task: Sonar task to run. (default: "")
+ :sonar-project-file: The filename for the project's properties
+ (default: "sonar-project.properties")
:sonar-properties: Sonar configuration properties. (default: "")
:sonar-java-opts: JVM options. (default: "")
:sonar-additional-args: Additional command line arguments. (default: "")
Requires ``SonarQube Scanner for Jenkins``
+.. note:: Sonar properties can be set directly in the job definition by
+ setting the sonar-project-file to ``""`` and adding all properties under
+ ``sonar-properties``.
+
:Required Parameters:
:lf-sonar-prescan: A builder that will run prior to the Sonar scan.
:Optional Parameters:
:sonar-task: Sonar task to run. (default: "")
+ :sonar-project-file: The filename for the project's properties
+ (default: "sonar-project.properties")
:sonar-properties: Sonar configuration properties. (default: "")
:sonar-java-opts: JVM options. (default: "")
:sonar-additional-args: Additional command line arguments. (default: "")
# Sonar properties
sonar-task: ""
+ sonar-project-file: "sonar-project.properties"
sonar-properties: ""
sonar-java-opts: ""
sonar-additional-args: ""
- lf-infra-pre-build
- lf-infra-sonar:
sonar-task: "{sonar-task}"
+ sonar-project-file: "{sonar-project-file}"
sonar-properties: "{sonar-properties}"
sonar-java-opts: "{sonar-java-opts}"
sonar-additional-args: "{sonar-additional-args}"
- lf-infra-pre-build
- lf-infra-sonar-with-prescan:
sonar-task: "{sonar-task}"
+ sonar-project-file: "{sonar-project-file}"
sonar-properties: "{sonar-properties}"
sonar-java-opts: "{sonar-java-opts}"
sonar-additional-args: "{sonar-additional-args}"
sonar-name: Sonar
scanner-name: SonarQubeScanner
task: "{sonar-task}"
- project: "sonar-project.properties"
+ project: "{sonar-project-file}"
properties: "{sonar-properties}"
java-opts: "{sonar-java-opts}"
additional-arguments: "{sonar-additional-args}"
sonar-name: Sonar
scanner-name: SonarQubeScanner
task: "{sonar-task}"
- project: "sonar-project.properties"
+ project: "{sonar-project-file}"
properties: "{sonar-properties}"
java-opts: "{sonar-java-opts}"
additional-arguments: "{sonar-additional-args}"
--- /dev/null
+---
+upgrade:
+ - |
+ Add sonar-project-file parameter to ci sonar jobs. By enabling the caller
+ to override the default project file name with an empty string, we enable
+ the ability to provide project settings directly in the sonar-properties
+ field. This removes the requirement for a "sonar-project.properties" file
+ in the repo.