0

是否可以配置与 mvn sonar:sonar post compile 一起使用时如何调用surefire插件。

例如,在我的 Maven 项目中,我有多个测试执行

<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>

请注意,集成测试特别需要一些预处理(例如 aspectj compile)。

有没有办法告诉声纳这样做?或者确实可以预先生成报告并告诉声纳使用它们吗?

4

1 回答 1

2

你可以看看reuse报告模式:http ://docs.codehaus.org/display/SONAR/Code+Coverage+by+Unit+Tests+for+Java+Project

于 2013-07-09T10:48:14.600 回答