Jacoco not excluding packages in the generated report

1,109 views
Skip to first unread message

krishnanghri reddy

unread,
Apr 7, 2015, 6:55:08 AM4/7/15
to jac...@googlegroups.com
Hi,

I am trying to exclude the packages from the coverage report using jacoco.When I set excludes using jacoco agent , I see in the generated report excluded package with 0% coverage where I need the entire package not to show up when excluded.

-javaagent:C:/Users/jacoco/jacocoagent.jar=includes=*,excludes=com.myservice.*,output=tcpserver,dumponexit=false,port=6300,address=*,append=false

Thanks
Krishnanghri

Marc Hoffmann

unread,
Apr 7, 2015, 7:51:00 AM4/7/15
to jac...@googlegroups.com
Hi,

you need to exclude the package at report generation time. How do you
generate the report?

Cheers,
-marc
> --
> You received this message because you are subscribed to the Google
> Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/13a80324-9c47-43cd-84e2-3c1eff1d69c6%40googlegroups.com
> [1].
> For more options, visit https://groups.google.com/d/optout [2].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/jacoco/13a80324-9c47-43cd-84e2-3c1eff1d69c6%40googlegroups.com?utm_medium=email&utm_source=footer
> [2] https://groups.google.com/d/optout

krishnanghri reddy

unread,
Apr 7, 2015, 12:49:24 PM4/7/15
to jac...@googlegroups.com
I am using ReportGenerator.java from jacoco/tests. I tried to set excludes but am not successful.

Marc R. Hoffmann

unread,
Apr 8, 2015, 7:03:27 PM4/8/15
to jac...@googlegroups.com
Hi,

the example processes all files in the classesDirectory, see:

analyzer.analyzeAll(classesDirectory);

If you want to filter classes/packages you need to implement your own
directory traversal mechanism and supply only those folders or class
files which should be included in the report.

Alternatively you might use a Ant script which already provides filesets
with includes and excludes.

Regards,
-marc

krishnanghri reddy

unread,
Apr 13, 2015, 11:31:41 PM4/13/15
to jac...@googlegroups.com
Hello Marc,

Thanks for your reply. I have tried it and it seems to work!

Thanks
Krishnanghri


--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/BnzdkNOzl0E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/5525B3BD.4010401%40mountainminds.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks
Krishnanghri
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages