MikePatel
MikePatel

Reputation: 2672

How does Sonar Maven Plugin orchestrate tests?

Is it possible to configure how the surefire plugin is called when used with mvn sonar:sonar post compile.

In my maven project I have multiple test executions, for example

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.3</version>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <configuration>
                            <excludes>
                                <exclude>**/*IntegrationTest.java</exclude>
                            </excludes>
                            <parallel>methods</parallel>
                            <useUnlimitedThreads>true</useUnlimitedThreads>
                            <argLine>${jacoco.agent.argLine}</argLine>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/*IntegrationTest.java</include>
                            </includes>
                            <parallel>classes</parallel>
                            <argLine>${jacoco.agent.argLineIntegration}</argLine>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Note the integration tests in particular require some preprocessing ( aspectj compile for example ).

Is there any way to tell sonar to do this ? Or Indeed is it possible to generate the reports beforehand and just tell sonar to use them ?

Upvotes: 0

Views: 630

Answers (1)

Related Questions