blob: ecb1aaa172ba0f4e68c310c920e19aed8fb34093 [file] [log] [blame]
Marc R. Hoffmanne571f3f2012-05-13 12:18:02 +00001<?xml version="1.0" encoding="UTF-8" ?>
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +00002<!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. Hoffmanne571f3f2012-05-13 12:18:02 +00005 <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 Mandrikov82a92ca2012-01-15 20:25:48 +00008 <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> &gt;
16 <a href="index.html" class="el_group">Documentation</a> &gt;
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. Hoffmann78309272012-05-02 19:25:44 +000034<h2>Example</h2>
35
Mirko Friedenhagen4c0198c2013-11-22 22:01:23 +010036<ul>
37 <li>
38 The JaCoCo distribution contains a simple example how code coverage
39 can be added to a Maven project.</li>
40 <li>
41 This <a href="examples/build/pom.xml">POM file</a>
42 for a JAR project runs JUnit tests under code coverage and creates a coverage
43 report (<tt>target/site/jacoco/index.html</tt>).
44 </li>
45 <li>
46 This <a href="examples/build/pom-it.xml">POM file</a>
47 for a JAR project runs unit tests and integration tests under code coverage
48 and creates two coverage reports, one for unit tests (
49 <tt>target/site/jacoco/index.html</tt>) and one for integration tests (
50 <tt>target/site/jacoco-it/index.html</tt>).
51 </li>
52 <li>
53 The complete example is located in the <code>./doc/examples/build</code>
Marc R. Hoffmann78309272012-05-02 19:25:44 +000054 folder of the distribution.
Mirko Friedenhagen4c0198c2013-11-22 22:01:23 +010055 </li>
56</ul>>
Marc R. Hoffmann78309272012-05-02 19:25:44 +000057
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +000058
59<h2>Prerequisites</h2>
60
61<p>
Marc R. Hoffmann91b99622012-05-02 17:35:14 +000062 The JaCoCo Maven plug-in requires
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +000063</p>
64
65<ul>
66 <li>Maven 2.1.0 or higher and</li>
67 <li>Java 1.5 or higher (for both, the Maven runtime and the test executor).</li>
68</ul>
69
70
71<h2>Usage</h2>
72
73<p>
Marc R. Hoffmann91b99622012-05-02 17:35:14 +000074 The Maven plug-in can be included in your build with the following
75 declaration. Please check
76 <a href="http://search.maven.org/#search|ga|1|g%3Aorg.jacoco%20a%3Ajacoco-maven-plugin">here</a>
77 for the latest release version in the repository.
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +000078</p>
79
80<pre class="source lang-xml linenums">
81&lt;plugin&gt;
82 &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
83 &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
84 &lt;version&gt;@project.version@&lt;/version&gt;
85&lt;/plugin&gt;
86</pre>
87
88<p>
Marc R. Hoffmann91b99622012-05-02 17:35:14 +000089 To receive a full list of goals and available parameters you can use
90 <code>maven-help-plugin</code>:
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +000091</p>
92<pre>
93mvn help:describe -Dplugin=org.jacoco:jacoco-maven-plugin -Ddetail
94</pre>
95
Marc R. Hoffmann871836b2012-05-12 12:28:13 +000096<h2>Goals</h2>
97
98<p>
99 The JaCoCo Maven plug-in defines the following goals:
100</p>
101
102<ul>
103 <li><a href="help-mojo.html">help</a></li>
104 <li><a href="prepare-agent-mojo.html">prepare-agent</a></li>
Mirko Friedenhagen4c0198c2013-11-22 22:01:23 +0100105 <li><a href="prepare-agent-integration-mojo.html">prepare-agent-integration</a></li>
Marc R. Hoffmannf5fa1a82013-11-10 14:09:23 +0100106 <li><a href="merge-mojo.html">merge</a></li>
Marc R. Hoffmann871836b2012-05-12 12:28:13 +0000107 <li><a href="report-mojo.html">report</a></li>
Marc R. Hoffmann4b990222014-01-06 21:51:23 +0100108 <li><a href="report-integration-mojo.html">report-integration</a></li>
Kyle Lieber7bcacd32012-11-06 21:48:33 -0600109 <li><a href="check-mojo.html">check</a></li>
Marc R. Hoffmannf5fa1a82013-11-10 14:09:23 +0100110 <li><a href="dump-mojo.html">dump</a></li>
Evgeny Mandrikove6f41d42013-01-11 15:37:36 +0100111 <li><a href="instrument-mojo.html">instrument</a></li>
Evgeny Mandrikovccff1372013-01-11 17:04:01 +0100112 <li><a href="restore-instrumented-classes-mojo.html">restore-instrumented-classes</a></li>
Marc R. Hoffmann871836b2012-05-12 12:28:13 +0000113</ul>
114
Evgeny Mandrikov82a92ca2012-01-15 20:25:48 +0000115</div>
116<div class="footer">
117 <span class="right"><a href="@jacoco.home.url@">JaCoCo</a> @qualified.bundle.version@</span>
118 <a href="license.html">Copyright</a> &copy; @copyright.years@ Mountainminds GmbH &amp; Co. KG and Contributors
119</div>
120
121</body>
122</html>