IntelliJ Maven项目ExtentTest类损坏问题及解决办法
问题解决:IntelliJ IDEA中ExtentReports核心类无法正常加载
已验证解决方案:升级至IntelliJ IDEA 2023.1.2后,该问题完全解决。
问题重现场景
在IntelliJ IDEA 2019.2中创建极简Maven项目,使用以下POM配置:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>a</groupId> <artifactId>a</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>5.0.9</version> </dependency> </dependencies> </project>
项目构建后,发现ExtentReports的核心类ExtentTest和ExtentReports未被正确识别,无法正常使用。
排查细节
- 同一设备上的Eclipse可正常运行该项目,其他机器的IntelliJ IDEA也无异常
- 本机IntelliJ IDEA的其他Maven操作均正常执行
- 已多次执行常规Maven故障排查步骤:删除本地
.m2仓库、清除IDE缓存等 - 经同事检查,未发现项目配置或Maven设置错误
- 所有涉及的类文件编码均为UTF-8
- 所有版本的ExtentReports(包括2.x版本)均受此问题影响
IDE日志输出
2023-06-12 08:30:46,132 [ 67872] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\n010215\seleniumtest' seleniumtestRunManager took 13 ms 2023-06-12 08:32:00,845 [ 142585] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 140 ms 2023-06-12 08:32:04,136 [ 145876] INFO - #org.jetbrains.idea.maven - [WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 2023-06-12 08:32:05,532 [ 147272] INFO - pl.ProjectRootManagerComponent - project roots have changed 2023-06-12 08:32:05,565 [ 147305] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 6ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:32:05,741 [ 147481] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 176ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:32:31,896 [ 173636] INFO - #org.jetbrains.idea.maven - [WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 2023-06-12 08:32:33,070 [ 174810] INFO - pl.ProjectRootManagerComponent - project roots have changed 2023-06-12 08:32:33,087 [ 174827] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 3ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:32:33,237 [ 174977] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 150ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:32:37,152 [ 178892] WARN - ution.rmi.RemoteProcessSupport - WARNING: An illegal reflective access operation has occurred 2023-06-12 08:32:37,152 [ 178892] WARN - ution.rmi.RemoteProcessSupport - WARNING: Illegal reflective access by com.intellij.util.ReflectionUtilRt (file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%20Community%20Edition%202019.2.2/lib/util.jar) to field java.lang.ApplicationShutdownHooks.hooks 2023-06-12 08:32:37,152 [ 178892] WARN - ution.rmi.RemoteProcessSupport - WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtilRt 2023-06-12 08:32:37,152 [ 178892] WARN - ution.rmi.RemoteProcessSupport - WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 2023-06-12 08:32:37,152 [ 178892] WARN - ution.rmi.RemoteProcessSupport - WARNING: All illegal access operations will be denied in a future release 2023-06-12 08:32:37,510 [ 179250] INFO - #org.jetbrains.idea.maven - [INFO] Using 'UTF-8' encoding to copy filtered resources. 2023-06-12 08:32:37,517 [ 179257] INFO - #org.jetbrains.idea.maven - [INFO] Copying 0 resource 2023-06-12 08:33:14,422 [ 216162] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\n010215\seleniumtest' seleniumtestRunManager took 13 ms 2023-06-12 08:33:26,277 [ 228017] INFO - pl.ProjectRootManagerComponent - project roots have changed 2023-06-12 08:33:26,290 [ 228030] INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 35 to update, calculated in 1ms 2023-06-12 08:33:26,354 [ 228094] INFO - .diagnostic.PerformanceWatcher - Reindexing refreshed files took 64ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:33:26,369 [ 228109] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 3ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:33:26,406 [ 228146] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 36ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:33:45,649 [ 247389] INFO - #org.jetbrains.idea.maven - [WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 2023-06-12 08:33:46,897 [ 248637] INFO - pl.ProjectRootManagerComponent - project roots have changed 2023-06-12 08:33:46,931 [ 248671] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 10ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:33:47,033 [ 248773] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 102ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:34:57,810 [ 319550] INFO - pl.ProjectRootManagerComponent - project roots have changed 2023-06-12 08:34:57,837 [ 319577] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:34:57,916 [ 319656] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 79ms; general responsiveness: ok; EDT responsiveness: ok 2023-06-12 08:35:01,283 [ 323023] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\n010215\seleniumtest' seleniumtestRunManager took 11 ms
内容的提问来源于stack exchange,提问作者graph
相关产品推荐
相关产品推荐

