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

ExtentReports开发中添加pom.xml依赖时出现报错求助

解决ExtentReports依赖添加后pom.xml报错问题
  • 核对依赖坐标准确性
    确保使用的ExtentReports依赖坐标符合官方规范,以下是当前稳定版的正确配置:

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>5.0.9</version>
        <scope>test</scope>
    </dependency>
    

    注意旧版本的groupId为com.relevantcodes,混用新旧坐标会直接引发报错。

  • 检查Maven仓库配置
    确认你的pom.xml或全局settings.xml中配置了Maven中央仓库,保证依赖能正常拉取:

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>
    
  • 排查依赖冲突
    执行Maven命令生成依赖树,定位冲突依赖:

    mvn dependency:tree
    

    若发现冲突,可通过<exclusions>标签排除冲突模块:

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>5.0.9</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>冲突的groupId</groupId>
                <artifactId>冲突的artifactId</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    
  • 刷新Maven项目
    在IDE中执行Maven -> Reload Project,或手动清理本地仓库后重新构建:

    mvn clean install -U
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 05:52:38