0

In my Java app, in order to generate coverage reports for my Unit Tests, I have tried several approaches to setup Jacoco as in Run with coverage or this page. However, I cannot generate coverage reports as expected and I think I need some steps describing the setup of Jacoco on IntelliJ. So, does anybody else have experience for setup and run it via command line as shown below:

mvn --global-settings ../settings.xml 
    -Dtest="/com/mycompany/core/service/impl/unit/ProductServiceImplTest.java" test

Any help would be appreciated.

  • "*I cannot generate coverage reports as expected*" - what does this exactly mean? what is your expectation? what you get? – Giorgi Tsiklauri Feb 02 '22 at 09:18
  • First, I need to install Jacoco in IntelliJ IDEA and generate coverage reports via command line. –  Feb 02 '22 at 09:19
  • have you tried changing "test" to "verify" on the command line? – DaveH Feb 02 '22 at 09:20
  • @harry we can't see whether you're using maven plugin, which exact version/plugin it is, how you configure it.. please include more information, as it's impossible to answer "*it's not working as expected*" question, without having, at least, some details. – Giorgi Tsiklauri Feb 02 '22 at 09:24
  • Thanks a lot for your helps. When I was looking for a solution, I found that I run first clean and then test tasks on Maven toolbar. Then the coverage reports are generated. **However**, I need to generate coverage reports for a specific package or class. So, how can I manage this? –  Feb 02 '22 at 10:46

0 Answers0