• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8" ?>
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=UTF-8" />
6  <link rel="stylesheet" href="resources/doc.css" charset="UTF-8" type="text/css" />
7  <link rel="stylesheet" href="../coverage/jacoco-resources/prettify.css" charset="UTF-8" type="text/css" />
8  <link rel="shortcut icon" href="resources/report.gif" type="image/gif" />
9  <style>
10    table, th, td {
11      border-collapse: collapse;
12      padding: 3px;
13    }
14    table tbody tr td {
15      border-left: #b0b0b0 3px solid;
16    }
17    table tbody tr td:nth-child(2) {
18      border-left: none;
19    }
20    th {
21      background-color:#e0e0e0;
22    }
23    table tbody td:hover {
24      background: #f0f0d0;
25    }
26  </style>
27  <script type="text/javascript" src="../coverage/jacoco-resources/prettify.js"></script>
28  <title>JaCoCo - Build</title>
29</head>
30<body onload="prettyPrint()">
31
32<div class="breadcrumb">
33  <a href="../index.html" class="el_report">JaCoCo</a> &gt;
34  <a href="index.html" class="el_group">Documentation</a> &gt;
35  <span class="el_source">Build</span>
36</div>
37<div id="content">
38
39<h1>Build</h1>
40
41<p>
42  The JaCoCo build is based on <a href="http://maven.apache.org/">Maven</a> and
43  can be locally executed on every machine with a proper
44  <a href="environment.html">environment setup</a>. In particular you need at
45  least <a href="http://maven.apache.org/">Maven 3.3.9</a> and JDK 8
46  installations. Developers are encouraged to run the build before every commit
47  to ensure consistency of the source tree.
48</p>
49
50
51<h2>Running the Build</h2>
52
53<p>
54  The build can be started by executing the following command with
55  <code>./org.jacoco.build/</code> as the working directory:
56</p>
57
58<pre>
59  mvn clean install
60</pre>
61
62<p>
63  Total build time is typically around 3 minutes, however first build might take
64  more time, because Maven should download plugins and dependencies. The
65  download ZIP will be created at the following location:
66</p>
67
68<pre>
69  ./jacoco/target/jacoco-<i>x.y.z.qualifier</i>.zip
70</pre>
71
72
73<h2>Running Quick Build without Tests</h2>
74
75<p>
76  It is not recommended, however possible to the run build without any tests:
77</p>
78
79<pre>
80  mvn clean install -DskipTests
81</pre>
82
83
84<h2>Compilation and testing with different JDKs</h2>
85
86<p>
87  By default for compilation and execution of tests will be used JDK that runs
88  Maven. Alternatively you can use JDK from
89  <a href="http://maven.apache.org/guides/mini/guide-using-toolchains.html">Maven
90  Toolchains</a> by setting property <code>jdk.version</code>.
91</p>
92
93<p>
94  Following table shows how modules will be compiled depending on version of JDK:
95</p>
96
97<table>
98  <thead>
99  <tr>
100    <th></th>
101    <th>JDK 5</th>
102    <th>JDK 6</th>
103    <th>JDK 7</th>
104    <th>JDK 8</th>
105    <th>JDK 9</th>
106    <th>JDK 10</th>
107    <th>JDK 11</th>
108    <th>JDK 12</th>
109  </tr>
110  </thead>
111  <tbody>
112  <tr>
113    <th>org.jacoco.core.test.validation.java8</th>
114    <td colspan="3">excluded from build</td>
115    <td colspan="5">compiled into bytecode version 52 (Java 8)</td>
116  </tr>
117  <tr>
118    <th>org.jacoco.core.test.validation.java7</th>
119    <td colspan="2">excluded from build</td>
120    <td colspan="6" rowspan="2">compiled into bytecode version 51 (Java 7)</td>
121  </tr>
122  <tr>
123    <th>org.jacoco.core.test.validation.groovy</th>
124    <td colspan="2">excluded from build</td>
125  </tr>
126  <tr>
127    <th>org.jacoco.core.test.validation.kotlin</th>
128    <td colspan="1">excluded from build</td>
129    <td colspan="6">compiled into bytecode version 50 (Java 6)</td>
130    <td rowspan="2">compiled into bytecode version 51 (Java 7)</td>
131  </tr>
132  <tr>
133    <th>all other modules</th>
134    <td colspan="4">compiled into bytecode version 49 (Java 5)</td>
135    <td colspan="3">compiled into bytecode version 50 (Java 6)</td>
136  </tr>
137  </tbody>
138</table>
139
140<p>
141  Alternatively you can specify bytecode version for all modules using property
142  <code>bytecode.version</code>.
143</p>
144
145<p>
146  For example to use JDK 10 from Maven Toolchains and compile all modules
147  into bytecode version 53 (Java 9):
148</p>
149
150<pre>
151  mvn clean install -Djdk.version=10 -Dbytecode.version=9
152</pre>
153
154<p>
155  Also Eclipse Compiler for Java can be used for compilation:
156</p>
157
158<pre>
159  mvn clean install -Decj
160</pre>
161
162<p>
163  Combining these options JaCoCo is regularly tested with the following setups:
164</p>
165
166<ul>
167  <li><code>mvn clean install -Djdk.version=5 -Dbytecode.version=5</code></li>
168  <li><code>mvn clean install -Djdk.version=6 -Dbytecode.version=6</code></li>
169  <li><code>mvn clean install -Djdk.version=7 -Dbytecode.version=7</code></li>
170  <li><code>mvn clean install -Djdk.version=8 -Dbytecode.version=8</code></li>
171  <li><code>mvn clean install -Djdk.version=8 -Dbytecode.version=8 -Decj</code></li>
172  <li><code>mvn clean install -Djdk.version=9 -Dbytecode.version=9</code></li>
173  <li><code>mvn clean install -Djdk.version=10 -Dbytecode.version=10</code></li>
174  <li><code>mvn clean install -Djdk.version=11 -Dbytecode.version=11</code></li>
175  <li><code>mvn clean install -Djdk.version=12 -Dbytecode.version=12</code></li>
176</ul>
177
178
179</div>
180<div class="footer">
181  <span class="right"><a href="@jacoco.home.url@">JaCoCo</a> @qualified.bundle.version@</span>
182  <a href="license.html">Copyright</a> &copy; @copyright.years@ Mountainminds GmbH &amp; Co. KG and Contributors
183</div>
184
185</body>
186</html>
187