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
相关产品推荐
相关产品推荐

