SonarQube常用参数

  • Post author:
  • Post category:其他


SonarQube常用的配置参数

无论是使用Maven sonar插件还是Sonar scanner,以下这些常用参数都是通用的。参数摘抄自

Analysis Parameters | SonarQube Docs

,为了避免翻译引起的歧义,所以参数直接采用官方文档的英文原版内容。

Key Description Default

sonar.host.url
the server URL
http://localhost:9000

sonar.projectKey
The project’s unique key. Allowed characters are: letters, numbers,

-

,

_

,

.

and

:

, with at least one non-digit.
For Maven projects, this defaults to

<groupId>:<artifactId>

sonar.projectName
Name of the project that will be displayed on the web interface.
<name>

for Maven projects, otherwise project key. If not provided and there is already a name in the DB, it won’t be overwritten

sonar.projectVersion
The project version.
<version>

for Maven projects, otherwise “not provided”

sonar.login
The

authentication token

or login of a SonarQube user with Execute Analysis permission on the project.

sonar.sources
Comma-separated paths to directories containing main source files. Read from build system for Maven, Gradle, MSBuild projects. Defaults to project base directory when neither

sonar.sources

nor

sonar.tests

is provided.

sonar.tests
Comma-separated paths to directories containing test source files. Read from build system for Maven, Gradle, MSBuild projects. Else default to empty.

sonar.coverage.jacoco.xmlReportPaths
Path to JaCoCo XML coverage reports. Path wildcards are supported (see above).

sonar.exclusions
不需要执行检查的源文件,支持通配符,可以用逗号连接多个路径。

sonar.test.exclusions
不需要执行检查的测试源文件,支持通配符,可以用逗号连接多个路径。



版权声明:本文为csflying原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。