jsr269 compile issue only effect in intellij 2020.2.2 version and above

This commit is contained in:
金戟 2020-12-25 17:48:30 +08:00
parent 32eefc25fe
commit 2d8433056c
2 changed files with 4 additions and 4 deletions

View File

@ -35,9 +35,9 @@ The `String` type in Kotlin language is actually `kotlin.String` instead of `jav
In actual scenarios, there are very few scenarios where methods in the `String` class need to be mocked, so `TestableMock` has not dealt with this situation specifically.
#### 6. When trigger a single test case in IntelliJ IDE, why class with `@EnablePrivateAccess` annotation report still private member access errors?
#### 6. When trigger a single test case in IntelliJ IDE 2020.3, why class with `@EnablePrivateAccess` annotation report still private member access errors?
The default compiler provided by IntelliJ handle the annotation processor of the `JSR-269` specification in an incompatible way of maven. You can turn on the "Delegate IDE build/run actions to maven" option in "Build Tools > Maven > Runner" of IntelliJ system configuration:
From version `2020.2.2`, the compiler provided by IntelliJ handle the annotation processor of the `JSR-269` specification in an incompatible way of maven. You can turn on the "Delegate IDE build/run actions to maven" option in "Build Tools > Maven > Runner" of IntelliJ system configuration:
![delegate-ide-build-to-maven](https://testable-code.oss-cn-beijing.aliyuncs.com/delegate-ide-build-to-maven.png)

View File

@ -35,9 +35,9 @@ Kotlin语言中的`String`类型实际上是`kotlin.String`,而非`java.lang.S
实际场景中需要对`String`类中的方法进行Mock的场景很少`TestableMock`暂未对这种情况做特别处理。
#### 6. 在IntelliJ IDE中运行单个测试用例时用了`@EnablePrivateAccess`注解还是报私有成员访问错误?
#### 6. 在IntelliJ IDE 2020.3版本中运行单个测试用例时,用了`@EnablePrivateAccess`注解还是报私有成员访问错误?
IntelliJ默认编译方法对`JSR-269`规范注解处理器的处理机制与Maven标准不完全兼容IntelliJ系统配置的"Build Tools > Maven > Runner"中开启"Delegate IDE build/run actions to maven"选项即可
IntelliJ从`2020.2.2`版本以后IntelliJ对`JSR-269`规范注解处理器的处理机制发生了变化与Maven标准不再完全兼容。可通过IntelliJ系统配置的"Build Tools > Maven > Runner"中开启"Delegate IDE build/run actions to maven"选项解决
![delegate-ide-build-to-maven](https://testable-code.oss-cn-beijing.aliyuncs.com/delegate-ide-build-to-maven.png)