Is there a way to run all test in an root pom and collect test coverage in Intellij Idea ?
-
Do you mean a multi-module maven project? – maba Jun 19 '13 at 11:59
-
Yes, I mean a pom with multiple sub-poms. – StKiller Jun 19 '13 at 12:05
3 Answers
Create a Run Configuration that will look for tests in the whole project. Make sure that you choose All in package
and In whole project
in the configurations dialog:
Make sure that you choose the <default>
package in the Choose Package
dialog.
Now you can select to run this configuration using Run 'All in project' with Coverage
:
The result will be presented in a separate coverate window:
And you will also see the result in the Project View
window for a fast overview:

- 47,113
- 10
- 108
- 118
Right click on the parent module (root pom), and select Run 'All Tests' with Coverage
.

- 2,617
- 23
- 33
-
9There is no such option when I right click on the root module. May be the problem is that this folder is not marked as source/test. – StKiller Jun 20 '13 at 06:25
-
1Works for me. Right-click the root directory where your `pom.xml` and `src` sit in. – Hubert Grzeskowiak Jun 27 '17 at 08:07
There is a 'Coverage' plugin, which may not be enabled by default.
Find it at File->Settings->Plugins
.
This will enable the 'Run with Coverage' buttons and menu items.
A short official overview video is here: Code Coverage by IntelliJ IDEA

- 51,587
- 17
- 154
- 173