1

使用 Jacoco 运行测试覆盖时出错。

我目前正在使用操作系统 Windows 10 Professional、Java 8、Gradle。

CLI 执行测试覆盖率报告我正在使用以下命令:

gradlew sonarqube -Dsonar.projectKey=projectKey -Dsonar.host.url=http://localhost:9000 -Dsonar.login=c231ced071c19ae0ab12342dfgd3fa17e85fd6a5

当我运行 jacoco 在本地 sonarqube 中发布报告时,出现以下错误:

Error occurred during initialization of VM

Error opening zip file or JAR manifest missing : build/tmp/expandedArchives/org.jacoco.agent-0.8.5.jar_6a2df60c47de373ea127d14406367999/jacocoagent.jar
agent library failed to init: instrument

Error occurred during initialization of VM

Error opening zip file or JAR manifest missing : build/tmp/expandedArchives/org.jacoco.agent-0.8.5.jar_6a2df60c47de373ea127d14406367999/jacocoagent.jar
agent library failed to init: instrument

Process 'Gradle Test Executor 2' finished with non-zero exit value 1

org.gradle.process.internal.ExecException: Process 'Gradle Test Executor 2' finished with non-zero exit value 1
          at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:417)
  at org.gradle.process.internal.worker.DefaultWorkerProcess.onProcessStop(DefaultWorkerProcess.java:141)

请需要您的意见来解决此问题。提前致谢。

4

1 回答 1

0

运行下一个命令gradlew clean build -d,这需要几秒钟。然后运行这个命令gradlew --stop

于 2021-04-01T13:45:00.137 回答