Marc R. Hoffmann | e571f3f | 2012-05-13 12:18:02 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 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> |
Marc R. Hoffmann | e571f3f | 2012-05-13 12:18:02 +0000 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <link rel="stylesheet" href=".resources/doc.css" charset="UTF-8" type="text/css" /> |
| 7 | <link rel="stylesheet" href="../coverage/.resources/prettify.css" charset="UTF-8" type="text/css" /> |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 8 | <link rel="shortcut icon" href=".resources/report.gif" type="image/gif" /> |
| 9 | <script type="text/javascript" src="../coverage/.resources/prettify.js"></script> |
| 10 | <title>JaCoCo - Maven Plug-in</title> |
| 11 | </head> |
| 12 | <body onload="prettyPrint()"> |
| 13 | |
| 14 | <div class="breadcrumb"> |
| 15 | <a href="../index.html" class="el_report">JaCoCo</a> > |
| 16 | <a href="index.html" class="el_group">Documentation</a> > |
| 17 | <span class="el_source">Maven Plug-in</span> |
| 18 | </div> |
| 19 | <div id="content"> |
| 20 | |
| 21 | <h1>Maven Plug-in</h1> |
| 22 | |
| 23 | <p> |
| 24 | The JaCoCo <a href="http://maven.apache.org/">Maven</a> plug-in provides the |
| 25 | JaCoCo runtime agent to your tests and allows basic report creation. |
| 26 | </p> |
| 27 | |
| 28 | <p class="hint"> |
| 29 | If you want to have line number information included in the coverage reports |
| 30 | or you want source code highlighting the class files of the test target must |
| 31 | be compiled with debug information. |
| 32 | </p> |
| 33 | |
Marc R. Hoffmann | 7830927 | 2012-05-02 19:25:44 +0000 | [diff] [blame] | 34 | <h2>Example</h2> |
| 35 | |
| 36 | <p> |
| 37 | The JaCoCo distribution contains a simple example how code coverage can be |
| 38 | added to a Maven project. This <a href="examples/build/pom.xml">POM file</a> |
| 39 | for a JAR project runs JUnit tests under code coverage and creates a coverage |
| 40 | report. The complete example is located in the <code>./doc/examples/build</code> |
| 41 | folder of the distribution. |
| 42 | </p> |
| 43 | |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 44 | |
| 45 | <h2>Prerequisites</h2> |
| 46 | |
| 47 | <p> |
Marc R. Hoffmann | 91b9962 | 2012-05-02 17:35:14 +0000 | [diff] [blame] | 48 | The JaCoCo Maven plug-in requires |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 49 | </p> |
| 50 | |
| 51 | <ul> |
| 52 | <li>Maven 2.1.0 or higher and</li> |
| 53 | <li>Java 1.5 or higher (for both, the Maven runtime and the test executor).</li> |
| 54 | </ul> |
| 55 | |
| 56 | |
| 57 | <h2>Usage</h2> |
| 58 | |
| 59 | <p> |
Marc R. Hoffmann | 91b9962 | 2012-05-02 17:35:14 +0000 | [diff] [blame] | 60 | The Maven plug-in can be included in your build with the following |
| 61 | declaration. Please check |
| 62 | <a href="http://search.maven.org/#search|ga|1|g%3Aorg.jacoco%20a%3Ajacoco-maven-plugin">here</a> |
| 63 | for the latest release version in the repository. |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 64 | </p> |
| 65 | |
| 66 | <pre class="source lang-xml linenums"> |
| 67 | <plugin> |
| 68 | <groupId>org.jacoco</groupId> |
| 69 | <artifactId>jacoco-maven-plugin</artifactId> |
| 70 | <version>@project.version@</version> |
| 71 | </plugin> |
| 72 | </pre> |
| 73 | |
| 74 | <p> |
Marc R. Hoffmann | 91b9962 | 2012-05-02 17:35:14 +0000 | [diff] [blame] | 75 | To receive a full list of goals and available parameters you can use |
| 76 | <code>maven-help-plugin</code>: |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 77 | </p> |
| 78 | <pre> |
| 79 | mvn help:describe -Dplugin=org.jacoco:jacoco-maven-plugin -Ddetail |
| 80 | </pre> |
| 81 | |
Marc R. Hoffmann | 871836b | 2012-05-12 12:28:13 +0000 | [diff] [blame] | 82 | <h2>Goals</h2> |
| 83 | |
| 84 | <p> |
| 85 | The JaCoCo Maven plug-in defines the following goals: |
| 86 | </p> |
| 87 | |
| 88 | <ul> |
| 89 | <li><a href="help-mojo.html">help</a></li> |
| 90 | <li><a href="prepare-agent-mojo.html">prepare-agent</a></li> |
| 91 | <li><a href="report-mojo.html">report</a></li> |
Kyle Lieber | 7bcacd3 | 2012-11-06 21:48:33 -0600 | [diff] [blame^] | 92 | <li><a href="check-mojo.html">check</a></li> |
Marc R. Hoffmann | 871836b | 2012-05-12 12:28:13 +0000 | [diff] [blame] | 93 | </ul> |
| 94 | |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 95 | </div> |
| 96 | <div class="footer"> |
| 97 | <span class="right"><a href="@jacoco.home.url@">JaCoCo</a> @qualified.bundle.version@</span> |
| 98 | <a href="license.html">Copyright</a> © @copyright.years@ Mountainminds GmbH & Co. KG and Contributors |
| 99 | </div> |
| 100 | |
| 101 | </body> |
| 102 | </html> |