简体   繁体   中英

Fail to collect coverage for java maven projects with Intellij IDE

I wanted to collect coverage info, but the error message is "At least 5 arguments expected but 1 found." I'm using IntelliJ IDE and maven projects and the Junit test framework. 在此处输入图像描述 在此处输入图像描述

Also, I noticed that the path of the first argument includes illegal characters, which are not in English and are part of the user name of my computer.

Alternatively, when I switched to Jacoco coverage tool instead of the tool provided by Intellij, the problem was "File Not Found Exception", the path of the file contained illegal characters.

I also tried uninstalling and reinstalling Intellij.

I really do not know how to solve it; I would appreciate it if anyone could give me some help.

在此处输入图像描述

Now I configured Jacoco in the POM file for my maven project and ran maven commands to collect code coverage.

The only solution that I found is to rename windows user. It is a painful operation with modification of regisrty.

Here is the instruction in Russian.

https://zen.yandex.ru/media/tehnichka/kak-pereimenovat-papku-polzovatelia-v-windows-10-5ffc31e6fe4e686f6ab950f5

May be you will find the same in English.

As exception suggests your attempt to run with coverage has leak of sufficient argument to be executed, namely

  • Directory to save test coverage result
  • Flag for identify the tracking per test
  • Flag to how calculate empty classes
  • Flag for how to use data files
  • Flag to indicate to run coverage in sampling (or tracing) mode

You can follow the official documentation for setting coverages in run configuration and passing required arguments regard to your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM