【问题标题】:aggregating surefire reports in MultiModule project在 MultiModule 项目中聚合万无一失的报告
【发布时间】:2022-11-11 10:24:26
【问题描述】:

我有多模块 maven 项目,我想获得汇总的肯定报告。我尝试了以下方法,但没有看到生成的汇总肯定报告。我可以看到为各个模块生成的报告。

我在单个模块(包装罐)中添加了以下插件配置

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit4</artifactId>
                    <version>2.22.0</version>
                </dependency>
            </dependencies>
            <configuration>
                <useManifestOnlyJar>false</useManifestOnlyJar>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </configuration>
        </plugin>

<reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <aggregate>true</aggregate>
                    <linkXRef>true</linkXRef>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

并在根级pom以下(包装类型pom)

<reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${version.plugin.surefire}</version>
                <inherited>false</inherited>
                <configuration>
                    <aggregate>true</aggregate>
                    <linkXRef>true</linkXRef>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

有人可以帮助我哪里出错了吗?

【问题讨论】:

    标签: java maven maven-plugin maven-surefire-plugin


    【解决方案1】:

    试试mvn surefire-report:report -Daggregate=true

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-27
      • 1970-01-01
      • 2013-06-05
      • 1970-01-01
      • 2018-09-09
      • 2017-09-07
      • 2013-03-11
      相关资源
      最近更新 更多