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" /> |
Evgeny Mandrikov | 8b21298 | 2016-06-12 17:55:49 +0200 | [diff] [blame^] | 6 | <link rel="stylesheet" href="resources/doc.css" charset="UTF-8" type="text/css" /> |
Evgeny Mandrikov | 28d5985 | 2016-06-11 12:41:17 +0200 | [diff] [blame] | 7 | <link rel="stylesheet" href="../coverage/jacoco-resources/prettify.css" charset="UTF-8" type="text/css" /> |
Evgeny Mandrikov | 8b21298 | 2016-06-12 17:55:49 +0200 | [diff] [blame^] | 8 | <link rel="shortcut icon" href="resources/report.gif" type="image/gif" /> |
Evgeny Mandrikov | 28d5985 | 2016-06-11 12:41:17 +0200 | [diff] [blame] | 9 | <script type="text/javascript" src="../coverage/jacoco-resources/prettify.js"></script> |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 10 | <title>JaCoCo - Build</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">Build</span> |
| 18 | </div> |
| 19 | <div id="content"> |
| 20 | |
| 21 | <h1>Build</h1> |
| 22 | |
| 23 | <p> |
Marc R. Hoffmann | c72f350 | 2016-05-18 12:41:10 +0200 | [diff] [blame] | 24 | The JaCoCo build is based on <a href="http://maven.apache.org/">Maven</a> and |
| 25 | can be locally executed on every machine with a proper |
| 26 | <a href="environment.html">environment setup</a>. In particular you need a |
| 27 | <a href="http://maven.apache.org/">Maven 3</a> installation. Developers are |
| 28 | encouraged to run the build before every commit to ensure consistency of the |
| 29 | source tree. |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 30 | </p> |
| 31 | |
| 32 | |
| 33 | <h2>Running the Build</h2> |
| 34 | |
| 35 | <p> |
| 36 | The build can be started by executing the following command with |
| 37 | <code>./org.jacoco.build/</code> as the working directory: |
| 38 | </p> |
| 39 | |
| 40 | <pre> |
| 41 | mvn clean install |
| 42 | </pre> |
| 43 | |
| 44 | <p> |
| 45 | Total build time is typically around 3 minutes, however first build might take |
| 46 | more time, because Maven should download plugins and dependencies. The |
| 47 | download ZIP will be created at the following location: |
| 48 | </p> |
| 49 | |
| 50 | <pre> |
Marc R. Hoffmann | c72f350 | 2016-05-18 12:41:10 +0200 | [diff] [blame] | 51 | ./jacoco/target/jacoco-<i>x.y.z.qualifier</i>.zip |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 52 | </pre> |
| 53 | |
| 54 | |
Marc R. Hoffmann | f6898ee | 2012-01-16 19:01:26 +0000 | [diff] [blame] | 55 | <h2>Running Quick Build without Tests</h2> |
| 56 | |
| 57 | <p> |
| 58 | It is not recommended, however possible to the run build without any tests: |
| 59 | </p> |
| 60 | |
| 61 | <pre> |
| 62 | mvn clean install -DskipTests |
| 63 | </pre> |
| 64 | |
| 65 | |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 66 | <h2>Testing with different JDKs</h2> |
| 67 | |
| 68 | <p> |
| 69 | Target Java version for JaCoCo builds is 1.5, however for verification |
| 70 | purposes you can execute tests using other versions. In order to do so, first |
| 71 | you should create file <code>toolchains.xml</code> in <code>~/.m2/</code> |
| 72 | directory. Here is an example of such file. For more information see |
| 73 | <a href="http://maven.apache.org/guides/mini/guide-using-toolchains.html">Maven |
| 74 | Guide to Using Toolchains</a>. |
| 75 | </p> |
| 76 | |
| 77 | <pre class="source lang-xml linenums"> |
| 78 | <?xml version="1.0" encoding="UTF8"?> |
| 79 | <toolchains> |
| 80 | <toolchain> |
| 81 | <type>jdk</type> |
| 82 | <provides> |
| 83 | <id>java15</id> |
| 84 | <version>1.5</version> |
| 85 | <vendor>sun</vendor> |
| 86 | </provides> |
| 87 | <configuration> |
| 88 | <jdkHome>/usr/lib/jvm/sun-jdk-1.5</jdkHome> |
| 89 | </configuration> |
| 90 | </toolchain> |
| 91 | <toolchain> |
| 92 | <type>jdk</type> |
| 93 | <provides> |
| 94 | <id>java16</id> |
| 95 | <version>1.6</version> |
| 96 | <vendor>sun</vendor> |
| 97 | </provides> |
| 98 | <configuration> |
| 99 | <jdkHome>/usr/lib/jvm/sun-jdk-1.6</jdkHome> |
| 100 | </configuration> |
| 101 | </toolchain> |
| 102 | <toolchain> |
| 103 | <type>jdk</type> |
| 104 | <provides> |
| 105 | <id>java17</id> |
| 106 | <version>1.7</version> |
| 107 | <vendor>sun</vendor> |
| 108 | </provides> |
| 109 | <configuration> |
| 110 | <jdkHome>/usr/lib/jvm/sun-jdk-1.7</jdkHome> |
| 111 | </configuration> |
| 112 | </toolchain> |
Marc R. Hoffmann | ae311b9 | 2014-05-01 07:07:10 +0200 | [diff] [blame] | 113 | <toolchain> |
| 114 | <type>jdk</type> |
| 115 | <provides> |
| 116 | <id>java18</id> |
| 117 | <version>1.8</version> |
| 118 | <vendor>sun</vendor> |
| 119 | </provides> |
| 120 | <configuration> |
| 121 | <jdkHome>/usr/lib/jvm/sun-jdk-1.8</jdkHome> |
| 122 | </configuration> |
| 123 | </toolchain> |
Marc R. Hoffmann | c72f350 | 2016-05-18 12:41:10 +0200 | [diff] [blame] | 124 | <toolchain> |
| 125 | <type>jdk</type> |
| 126 | <provides> |
| 127 | <id>java19</id> |
| 128 | <version>1.9</version> |
| 129 | <vendor>sun</vendor> |
| 130 | </provides> |
| 131 | <configuration> |
| 132 | <jdkHome>/usr/lib/jvm/sun-jdk-1.9</jdkHome> |
| 133 | </configuration> |
| 134 | </toolchain> |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 135 | </toolchains> |
| 136 | </pre> |
| 137 | |
| 138 | <p> |
| 139 | Now you should be able to execute maven build with specified version of JDK: |
| 140 | </p> |
| 141 | |
| 142 | <pre> |
| 143 | mvn clean install -Djdk.version=<i>version</i> |
| 144 | </pre> |
| 145 | |
| 146 | <p> |
| 147 | Location of <code>toolchains.xml</code> can be set via an option: |
| 148 | </p> |
| 149 | |
| 150 | <pre> |
| 151 | mvn --toolchains <i>path</i> clean install -Djdk.version=<i>version</i> |
| 152 | </pre> |
| 153 | |
Marc R. Hoffmann | 3f11b0a | 2012-06-20 20:45:23 +0000 | [diff] [blame] | 154 | <p> |
| 155 | In addition JaCoCo can be compiled for higher class file versions than 1.5 |
| 156 | specifying the property <code>bytecode.version</code>. Note that in this case |
| 157 | the version of the JVM running Maven must be at least the version of the |
| 158 | specified bytecode version as this JVM is also running the tests. Combining |
| 159 | these options JaCoCo is regularly tested with the following setups: |
| 160 | </p> |
| 161 | |
| 162 | <ul> |
Marc R. Hoffmann | ae311b9 | 2014-05-01 07:07:10 +0200 | [diff] [blame] | 163 | <li>Maven with 1.5 JDK: <code>mvn clean install -Djdk.version=1.5 -Dbytecode.version=1.5</code></li> |
| 164 | <li>Maven with 1.6 JDK: <code>mvn clean install -Djdk.version=1.6 -Dbytecode.version=1.6</code></li> |
| 165 | <li>Maven with 1.7 JDK: <code>mvn clean install -Djdk.version=1.7 -Dbytecode.version=1.7</code></li> |
| 166 | <li>Maven with 1.8 JDK: <code>mvn clean install -Djdk.version=1.8 -Dbytecode.version=1.8</code></li> |
Marc R. Hoffmann | c72f350 | 2016-05-18 12:41:10 +0200 | [diff] [blame] | 167 | <li>Maven with 1.9 JDK: <code>mvn clean install -Djdk.version=1.9 -Dbytecode.version=1.9</code></li> |
Marc R. Hoffmann | 3f11b0a | 2012-06-20 20:45:23 +0000 | [diff] [blame] | 168 | </ul> |
| 169 | |
Evgeny Mandrikov | 82a92ca | 2012-01-15 20:25:48 +0000 | [diff] [blame] | 170 | |
| 171 | </div> |
| 172 | <div class="footer"> |
| 173 | <span class="right"><a href="@jacoco.home.url@">JaCoCo</a> @qualified.bundle.version@</span> |
| 174 | <a href="license.html">Copyright</a> © @copyright.years@ Mountainminds GmbH & Co. KG and Contributors |
| 175 | </div> |
| 176 | |
| 177 | </body> |
| 178 | </html> |