Integrating jacoco while building the project

42 views
Skip to first unread message

ssdha...@gmail.com

unread,
Apr 23, 2015, 4:52:58 AM4/23/15
to jac...@googlegroups.com
Hi everyone ,
I need to know that if we can integrate jacoco agent while my application is getting built by ant , so that i don't need to set any jvm option to hook into jvm .
Thanx in advance

Marc Hoffmann

unread,
Apr 23, 2015, 5:03:35 AM4/23/15
to jac...@googlegroups.com
Hi,

instead of using the JaCoCo agent you could pre-instrument your classes
under test and package the agent as regular JAR with your application.
We call this "offline instrumentation", see documentation:

http://www.eclemma.org/jacoco/trunk/doc/offline.html

Regards,
-marc

ssdha...@gmail.com

unread,
May 2, 2015, 12:50:05 AM5/2/15
to jac...@googlegroups.com
Then how we will get coverage data i.e. Exec file

ssdha...@gmail.com

unread,
May 2, 2015, 12:50:22 AM5/2/15
to jac...@googlegroups.com

Marc R. Hoffmann

unread,
May 4, 2015, 12:10:45 AM5/4/15
to jac...@googlegroups.com
By default the exec file is written at JVM shutdown. Alternatively you
can request data remotly through TCP connections or request a dump via
JMX. See config options output and jmx:

http://www.eclemma.org/jacoco/trunk/doc/agent.html

The report task will create a coverage report from the exec file, the
class files and optionally source files:

http://www.eclemma.org/jacoco/trunk/doc/ant.html#report
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages