Hello Andrew,
At the moment, the maven plugin's clean and install work, but when I go to run a test ...
Could you describe more precisely how do you perform your build?
- do you import the Maven-based project (pom.xml) into IntelliJ, next open the "Maven Projects" view, right click on "clean, install" targets and choose "Run my_project [clean, install]" from context menu?
- do you have com.atlassian.maven.plugins:maven-clover2-plugin defined in your POM?
- do you have com.cenqua.clover:clover defined in POM?
- do you have "Toggle build with Clover" button enabled in IntelliJ toolbar?
- do you have Clover IntelliJ settings (File > Settings > Project Settings > Clover; initstring) synchronized somehow with Clover Maven settings (pom.xml / <plugins> / maven-clover2-plugin / <configuration> / <cloverDatabase>)?
I have reproduced lack of code coverage in a slightly different scenario:
- import maven-based (pom.xml) project into IntelliJ
- set "javac-in-process" compiler in File > Settings > Compiler
- enable "Toggle build with Clover" on toolbar
- run unit tests using IntelliJ JUnit test runner, for example
- right click on test class, chose "Run <MyClassTest>" option or
- main menu > Run > Edit configurations > JUnit > ... choose test classes; next run it
After this code coverage does not refresh and shows 0% for all classes.
In case when "javac" compiler is used, coverage refreshes, but only for test classes (app classes still show 0%).
Is my scenario somehow similar to yours?
Regards
Marek
Hi Marek,
I do tend to use the maven compile goal, but given your feedback, I have since stopped doing this and life is great with intellij and clover. Thanks so much...this has really helped my development every day!