You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

net.masterthought maven-cucumber-reporting报告不显示嵌入图片链接问题

问题原因及解决方法

核心原因

你当前使用的maven-cucumber-reporting 4.3.0版本默认关闭了嵌入资源展示开关,你的配置中缺失对应启用参数。

修复步骤

  1. 在插件的configuration节点中添加addEmbeddings配置项,设置为true,该参数控制是否在报告中渲染截图等嵌入资源,4.x版本默认值为false。
    修改后的完整配置如下:
<plugin>
    <groupId>net.masterthought</groupId>
    <artifactId>maven-cucumber-reporting</artifactId>
    <version>4.3.0</version>
    <executions>
        <execution>
            <id>execution</id>
            <phase>verify</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <projectName>cucumber-jvm-example</projectName>
                <skip>false</skip>
                <outputDirectory>target/cucumber-reports/advanced-reports</outputDirectory>
                <inputDirectory>${project.build.directory}/cucumber-reports</inputDirectory>
                <jsonFiles>
                    <param>**/cucumber.json</param>
                </jsonFiles>
                <classificationDirectory>target/cucumber-reports/advanced-reports</classificationDirectory>
                <classificationFiles>
                    <param>sample.properties</param>
                    <param>other.properties</param>
                </classificationFiles>
                <checkBuildResult>false</checkBuildResult>
                <!-- 新增配置 启用嵌入资源展示 -->
                <addEmbeddings>true</addEmbeddings>
            </configuration>
        </execution>
    </executions>
</plugin>
  1. 配置修改完成后重新执行mvn clean install命令即可在错误步骤详情中看到截图链接。

额外排查点

如果添加配置后仍未展示截图,可检查以下两项:

  • 确认target/cucumber-reports/advanced-reports目录下的embeddings文件夹与生成的html报告文件处于同一层级
  • 可将maven-cucumber-reporting版本升级至4.8.1,与你使用的Cucumber版本兼容性更好,避免版本兼容导致的渲染异常

内容的提问来源于stack exchange,提问作者xyuste

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.01 09:09:02