是否可以在没有任何构建过程的情况下在Jenkins上运行Sonar插件?

 君子淡如水2012 发布于 2023-01-04 13:07

我想在没有任何构建过程的Jenkins上运行Sonar插件(我的意图是在Jenkins中集成Sonar分析并利用我们已经拥有的subversion插件和配置).

我不想运行构建过程,因为这会占用不必要的时间; 我只想让Jenkins的工作专门用于声纳分析.

1 个回答
  • 你可以做到这一点.您必须使用SonarQube Runner触发分析.

      转到Build部分,单击Add build step并选择Invoke Standalone Sonar Analysis

      配置SonarQube分析.您可以指向现有的sonar-project.properties文件,也可以直接在"项目属性"字段中设置分析属性

    使用SonarQube Runner进行分析时,您应该提供以下强制属性:

    sonar.projectKey=my:project
    sonar.projectName=My project
    sonar.projectVersion=1.0
    
    # Path to the parent source code directory.
    # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
    # Since SonarQube 4.2, this property is optional. If not set, SonarQube starts looking for source code
    # from the directory containing the sonar-project.properties file.
    sonar.sources=src
    

    在这种情况下,您可能会错过一些规则违规(如FindBugs),因为未提供.class文件.您必须手动构建项目并将sonar.binaries属性设置为类文件.如果您从不想构建项目,那么您也可以使用SonarQube的SourceMeter插件.它只需要源文件,但如果需要可以产生更多指标和问题.

    2023-01-04 13:09 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有