首页 > 解决方案 > 在 Maven 阶段使用 JaCoCo 的最佳方式是什么?

问题描述

在 Maven 阶段使用 JaCoCo 的最佳方式是什么?我的意思是我应该选择哪个阶段在我的 ci 管道中运行 JaCoCo?Test相或verify?两种使用方式有什么区别?我的 POM 文件中有三个执行部分。

             <executions>
                <execution>
                    <id>default-prepare-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>target/jacoco-report</outputDirectory>
                    </configuration>
                </execution>
                <execution>
                    <id>check</id>
                    <phase>test</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>

而且我不明白我应该如何为每个执行部分选择阶段。

标签: javamavenjacocojacoco-maven-pluginjacoco-plugin

解决方案


推荐阅读