'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.
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Lunatic |