Marc R. Hoffmann | 57f9ab4 | 2009-08-24 10:52:42 +0000 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="ISO-8859-1" ?>
|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
| 4 | <head>
|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
| 6 | <link rel="stylesheet" href=".resources/doc.css" charset="ISO-8859-1" type="text/css" />
|
| 7 | <title>JaCoCo - Java Agent</title>
|
| 8 | </head>
|
| 9 | <body>
|
| 10 |
|
| 11 | <div class="breadcrumb">
|
| 12 | <a href="../index.html" class="el_session">JaCoCo</a> >
|
| 13 | <a href="index.html" class="el_group">Documentation</a> >
|
| 14 | <span class="el_source">Java Agent</span>
|
| 15 | </div>
|
| 16 |
|
| 17 | <h1>Java Agent</h1>
|
| 18 |
|
| 19 | <p>
|
| 20 | JaCoCo uses class file instrumentation to record execution coverage data.
|
| 21 | Class files are instrumented on-the-fly using a so called Java agent. This is
|
| 22 | mechanism allows in-memory pre-processing of all class files during class
|
| 23 | loading independent of the application framework.
|
| 24 | </p>
|
| 25 |
|
| 26 | <p class="hint">
|
| 27 | If you use the <a href="ant.html">JaCoCo Ant tasks</a> you don't have to care
|
| 28 | about the agent and its options directly. All set-up is transparently handled
|
| 29 | by the Ant tasks implementation.
|
| 30 | </p>
|
| 31 |
|
| 32 | <p>
|
| 33 | The agent <code>jacocoagent.jar</code> is part of the JaCoCo distribution and
|
| 34 | includes all required dependencies. A Java agent can be activated with the
|
| 35 | following JVM option:
|
| 36 | </p>
|
| 37 |
|
| 38 | <pre>
|
| 39 | -javaagent:<i>[yourpath/]</i>jacocoagent.jar=<i>[option1]</i>=<i>[value1]</i>,<i>[option2]</i>=<i>[value2]</i>
|
| 40 | </pre>
|
| 41 |
|
| 42 | <p>
|
| 43 | The JaCoCo agent accepts the following options:
|
| 44 | </p>
|
| 45 |
|
| 46 | <table class="coverage">
|
| 47 | <thead>
|
| 48 | <tr>
|
| 49 | <td>Option</td>
|
| 50 | <td>Description</td>
|
| 51 | <td>Default</td>
|
| 52 | </tr>
|
| 53 | </thead>
|
| 54 | <tbody>
|
| 55 | <tr>
|
| 56 | <td><code>file</code></td>
|
| 57 | <td>Path to the output file for execution data.</td>
|
| 58 | <td><code>jacoco.exec</code></td>
|
| 59 | </tr>
|
| 60 | <tr>
|
| 61 | <td><code>merge</code></td>
|
| 62 | <td>If set to <code>true</code> and the execution data file already
|
| 63 | exists, coverage data is merged to the existing file. If set to
|
| 64 | <code>false</code>, an existing execution data file will be replaced.
|
| 65 | </td>
|
| 66 | <td><code>true</code></td>
|
| 67 | </tr>
|
| 68 | <tr>
|
| 69 | <td><code>exclclassloader</code></td>
|
| 70 | <td>A list of class loader names, that should be excluded from execution
|
| 71 | analysis. The list entries are separated by a vertical bar
|
| 72 | (<code>|</code>) and may use wildcard characters (<code>*</code> and
|
| 73 | <code>?</code>). This option might be required in case of special
|
| 74 | frameworks that conflict with JaCoCo code instrumentation, in
|
| 75 | particular class loaders that do not have access to the Java runtime
|
| 76 | classes.
|
| 77 | </td>
|
| 78 | <td><code>sun.reflect.DelegatingClassLoader</code></td>
|
| 79 | </tr>
|
| 80 | </tbody>
|
| 81 | </table>
|
| 82 |
|
| 83 |
|
| 84 | <div class="footer">
|
| 85 | <div class="versioninfo"><a href="@HOMEURL@">JaCoCo</a> @VERSION@</div>
|
| 86 | <a href="license.html">Copyright</a> © 2009 Mountainminds GmbH & Co. KG and Contributors
|
| 87 | </div>
|
| 88 |
|
| 89 | </body>
|
| 90 | </html> |