Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate two sonar reports from the same project?

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?

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

like image 336
Petteri H Avatar asked Dec 12 '22 05:12

Petteri H


1 Answers

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>
like image 167
Andrzej Jozwik Avatar answered Dec 28 '22 06:12

Andrzej Jozwik