Jenkins和SonarQube集成
安装插件SonarQube Scanner for Jenkins
- 系统管理 - 插件管理
- 可选插件(没有内容点立即获取)
- 过滤 - 搜索SonarQube
- 安装SonarQube Scanner for Jenkins
- 安装成功 - 重启
配置插件
- 系统管理 - 系统设置 - SonarQube servers
给项目配置启动SonarQube
创建一个maven项目
配置maven项目
配置SonarQube
构建环境 - Pre Steps/Post Steps - Add pre-build step - Execute SonarQube Scanner1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17//多模块配置
project_key =
project_name =
1.0 =
UTF-8 =
root,core =
./ =
com.thirdservice =
src/main/java =
target/classes =
third/core/ =
com.bridge =
src/main/java =
target/classes =配置参数
相关问题(注意)
- mysql参数设置问题
1
2
3
4
5
6
7
8
9
10
11
1217:08:15.777 DEBUG: Upload report
17:08:22.648 DEBUG: POST 500 http://192.168.99.108:9000/api/ce/submit?projectKey=bi_build_sonar&projectName=bi_build_sonar | time=6864ms
17:08:22.662 INFO: ------------------------------------------------------------------------
17:08:22.663 INFO: EXECUTION FAILURE
17:08:22.663 INFO: ------------------------------------------------------------------------
17:08:22.663 INFO: Total time: 5:01.152s
17:08:22.951 INFO: Final Memory: 47M/1469M
17:08:22.951 INFO: ------------------------------------------------------------------------
17:08:22.951 ERROR: Error during SonarQube Scanner execution
17:08:22.951 ERROR: Failed to upload report - An error has occurred. Please contact your administrator
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
ERROR: SonarQube scanner exited with non-zero code: 11
2
3SHOW VARIABLES LIKE 'max_allowed_packet';
修改/etc/my.cnf文件:
max_allowed_packet = 100M