这里只有流水线加活动,没有代码审查标签,不过由于没办法联网sonarqube不是用helm部署的,是用yaml部署pg数据库和sonarqube,按照指定那篇文章配置了,并更新了所有配置。
求解:按照3.0文档配置,SonarQube(代码审查)小标签无法显示在devops流水线上
shaowenchenK零SK贰SK壹S
minisheep
文档评论里面还有配置
shaowenchen 大佬,帮忙解答下,k8s集群结点都是不能联网的,不知道有没有关系,我按照您的文章一步一步配置,出了第一步没有用helm安装和命名空间不同,其他完全一样,还有3.0还需要在devops流程上配置sonarqube吗?
shaowenchen devops上的流程withSonarQubeEnv(‘sonar’) 之类的这些配置都被我注释掉了,应该关系不大吧,是不是只要运行完devops就会出现在页面上。
shaowenchen 评论的配置我也配了。
shaowenchenK零SK贰SK壹S
不能注释。安装这个文档和评论进行配置,https://kubesphere.com.cn/forum/d/2044-kubesphere-v3-0-0-sonarqube 。示例文档快出来了。
流水线运行过 sonarqube ,页面才会有 tab 以供查看。
shaowenchen 那我是不是在后端工程的setting.xml也要配置sonar的信息,还是只需要在devops流程中指定host.url等信息就行了?
shaowenchenK零SK贰SK壹S
先用 Demo 试一下,https://github.com/kubesphere/devops-java-sample/blob/b5fa900af1f8ff5634db089515e7bf4eec7667cc/Jenkinsfile-online 。按照文档配置之后,setting 里面不需要单独配置 host。
shaowenchen 大佬,还有个问题咨询下,现在是否支持jacoco的集成,如果需要集成覆盖率应该怎么一个做法呢。
shaowenchenK零SK贰SK壹S
目前没有集成 jacoco。如果集成,需要安装 Jenkins 插件,然后在maven中配置插件,配置sonarqube 参数,就可以在 sonarqube 的页面上看到结果。可以通过 kubesphere devops 提供的 sonarqube 跳转链接查看结果。
- 已编辑
minisheep 请教下,我们环境也是自己部署的sonarqube 7.5,但代码分析时一直报错:
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-jar-plugin' from the repositories [local (/root/.m2/repository), alimaven (http://maven.aliyun.com/nexus/content/repositories/central/)]: Plugin not found in any plugin repository -> [Help 1]
但本地仓库中是有这个插件的,这是是否对sonarqube版本还有要求的?
shaowenchenK零SK贰SK壹S
ethan_x
安装提示是本地找不到对应版本,可以现在本地执行调试一下,确认配置是否正确。
ziyouguoduK零S
自己部署的sonarqube 7.1, 代码分析时报错:Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project
LuLiMingAmosK零S
- 最佳回复由 minisheep 选择
sonarqube 无法在流水线上显示,求解
LuLiMingAmos 首先sonarqube得先过扫描才能显示,其次工程pom得引入sonar的依赖,然后根据楼上大佬有一篇文章进行配置,git上也有官方提供的样例代码,可以参考。
博主,你的devops的流水线ui上显示sonar了么?如果解决了可以共享下么
shaowenchen 你好 我使用helm安装sonarqube报错:Error: unknown shorthand flag: ‘n’ in -n
shaowenchen 你好 我使用helm安装sonarqube报错:Error: unknown shorthand flag: ‘n’ in -n 、在你的文档中查看的
shaowenchenK零SK贰SK壹S
示例中用的 helm3。是不是使用了 helm2?安装或者外置的 sonaqube 都可以,这里只需要安装上就行