如何从同一个项目生成两个声纳报告? [英] How to generate two sonar reports from the same project?

查看:21
本文介绍了如何从同一个项目生成两个声纳报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从同一个项目创建两组声纳报告.一种会涵盖所有内容,另一种会排除一些软件包.

I would like to create two sets of Sonar reports from the same project. One would have everything covered and the other one would have some packages excluded.

这可能吗?如果可以,该怎么做?

Is this possible and if so, how to do such?

设置排除项不是问题,但有两个报告是.

Setting exclusions is not a problem but having two reports is.

推荐答案

在 maven 中创建新配置文件并为每个配置文件添加带有新分支的调用声纳:mvn clean install -Pprofile1 sonar:sonar -Dsonar.branch=BRANCH1

Create new profile in maven and add call sonar with new branch for each profile: mvn clean install -Pprofile1 sonar:sonar -Dsonar.branch=BRANCH1

   <properties>
       <sonar.branch>
          DEFAULT_BRANCH
        </sonar.branch>
    </properties>
 
    <profiles>
            <profile>
                <id>sonar</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <properties>
                    <sonar.host.url>
                      http://localhost:9000
                    </sonar.host.url>
                </properties>
            </profile>
            <profile>
                <id>profile1</id>                
                <properties>
                    <!-- Optional URL to server. Default value is http://localhost:9000 -->
                    <sonar.host.url>
                      http://myserver:9000
                    </sonar.host.url>
                </properties>
            </profile>
         </profiles>

这篇关于如何从同一个项目生成两个声纳报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆