有什么方法可以让 PowerMockito 类 的 Jacoco 代码覆盖率?

Is there any way to get Jacoco code coverage for PowerMockito classes?

在我的项目中,我使用了 Powermockito。 但是 Jacoco 没有显示 powermockito 类 的覆盖范围。 我用过下面的罐子。 你能帮我解决一下吗?

testCompile group: 'junit', name: 'junit', version:'4.12'
    testCompile group: 'org.easymock', name: 'easymock', version: '4.0.1'
    testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
    testCompile group: 'org.javassist', name: 'javassist', version: '3.20.0-GA'
    testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
    testCompile group: 'org.objenesis', name: 'objenesis', version: '2.1'
    testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.4'
    testCompile group: 'org.powermock', name: 'powermock-api-support', version: '1.6.4'
    testCompile group: 'org.powermock', name: 'powermock-core', version: '1.6.4'
    testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.4'
    testCompile group: 'org.powermock', name: 'powermock-module-junit4-common', version: '1.6.4'
    testCompile group: 'org.powermock', name: 'powermock-reflect', version: '1.6.6'
    testCompile group: 'org.powermock', name: 'powermock-api-mockito-common', version: '1.6.6'


jacoco {
                    toolVersion = '0.7.5.201505241946'
    }

PowerMock 不适用于 Jacoco。我觉得很痛。

Here是打开的bug。

有些人报告这是工作配置,因此您可以尝试:

工作配置:

jacoco-maven-plugin 0.7.7.201606060606
powermock 1.6.5