|
| 1 | +--- |
| 2 | +title:"Building Multiple Flink Releases on Windows" |
| 3 | +weight:120 |
| 4 | +type:docs |
| 5 | +aliases: |
| 6 | + -/docs/dev/build/windows-multi-release |
| 7 | +--- |
| 8 | + |
| 9 | +#Building Multiple Flink Releases on Windows |
| 10 | + |
| 11 | +This guide describes how to build multiple historical releases of Apache Flink on Windows using Maven. |
| 12 | +Although most users build only the release that matches their application, certain research, academic, and analysis scenarios may require building many versions—e.g., when using metric extraction and static-analysis tools such as SpotBugs. |
| 13 | + |
| 14 | +This document provides practical, verified build instructions for the following releases: |
| 15 | + |
| 16 | +- 2.1.0 |
| 17 | +- 2.0.0 |
| 18 | +- 1.20.0 |
| 19 | +- 1.19.0 |
| 20 | +- 1.18.0 |
| 21 | +- 1.17.0 |
| 22 | +- 1.16.0 |
| 23 | +- 1.15.0 |
| 24 | +- 1.14.0 |
| 25 | +- 1.13.0 |
| 26 | +- 1.12.0 |
| 27 | +- 1.11.0 |
| 28 | +- 1.10.0 |
| 29 | +- 1.9.0 |
| 30 | +- 1.8.0 |
| 31 | +- 1.7.0 |
| 32 | +- 1.6.0 |
| 33 | +- 1.5.0 |
| 34 | +- 1.4.0 |
| 35 | +- 1.3.0 |
| 36 | + |
| 37 | +The build process is documented from the newest release down to the oldest, as older versions require increasingly specific workarounds. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +##Prerequisites |
| 42 | + |
| 43 | +The instructions below were last verified on: |
| 44 | + |
| 45 | +-**Windows 11 Home Single Language (version 25H2)** |
| 46 | +-**PowerShell** |
| 47 | +-**Maven 3.8.6** |
| 48 | +-**64-bit Java runtimes** |
| 49 | + |
| 50 | +To avoid issues with long file paths and Unicode characters, place all release directories under`C:\releases`, for example: |
| 51 | + |
| 52 | +C:\ <br> |
| 53 | +|_releases<br> |
| 54 | +| |\_\_\_\_flink-release-x.x.x<br> |
| 55 | +| |\_\_\_\_flink-release-x.x.x<br> |
| 56 | +| |\_\_\_\_etc...<br> |
| 57 | +|etc...<br> |
| 58 | + |
| 59 | + |
| 60 | +Some Flink modules (e.g.,`flink-table-planner_2.11`) generate paths close to Windows’ 260-character limit. Keeping paths short avoids build failures. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +#Build Instructions by Release |
| 65 | + |
| 66 | +Each release section below includes the required Java version, recommended Maven commands, and workarounds for shaded JAR generation, blocked HTTP downloads, or missing legacy dependencies. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +##Flink 2.1.0, 2.0.0, 1.20.0, 1.19.0, 1.18.0 |
| 71 | + |
| 72 | +**Java:** 17.0.12 |
| 73 | +**Maven:** 3.8.6 |
| 74 | + |
| 75 | +Run: |
| 76 | + |
| 77 | +```powershell |
| 78 | +mvn spotless:apply |
| 79 | +mvn clean install -DskipTests -Pskip-webui-build -T 1C |
| 80 | +``` |
| 81 | +**Notes:** |
| 82 | +<ul> |
| 83 | +<li>spotless:apply formats the source code according to formatting rules defined in the POM.</li> |
| 84 | +<li>-T 1C flag uses one thread per CPU core to speed up builds.</li> |
| 85 | +</ul> |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +##Flink 1.17.0 |
| 90 | + |
| 91 | +**Java:** 11.0.28 |
| 92 | +**Maven:** 3.8.6 |
| 93 | + |
| 94 | +Starting with Flink 1.17 and below, multi-threaded builds may hang during the creation of shaded JARs.**Do not use**```-T```**for these versions** |
| 95 | + |
| 96 | +Run: |
| 97 | + |
| 98 | +```powershell |
| 99 | +mvn spotless:apply |
| 100 | +mvn clean install -DskipTests -Pskip-webui-build |
| 101 | +``` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +##Flink 1.16.0, 1.15.0, 1.14.0, 1.13.0 |
| 106 | + |
| 107 | +**Java:** 11.0.28 |
| 108 | +**Maven:** 3.8.6 |
| 109 | + |
| 110 | +These versions may attempt to download the dependency |
| 111 | +`pentaho-aggdesigner-algorithm-5.1.5-jhyde` |
| 112 | +via HTTP, which Maven 3.8.x blocks by default. |
| 113 | + |
| 114 | +Because the original repository is no longer available, download the dependency manually: |
| 115 | + |
| 116 | +###Workaround for pentaho-aggdesigner-algorithm |
| 117 | + |
| 118 | +<ol> |
| 119 | +<li>Go to: |
| 120 | + https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/ |
| 121 | +</li> |
| 122 | +<li> |
| 123 | + Download: |
| 124 | + <ul> |
| 125 | + <li> |
| 126 | + pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar |
| 127 | + </li> |
| 128 | + <li> |
| 129 | + pentaho-aggdesigner-algorithm-5.1.5-jhyde.pom |
| 130 | + </li> |
| 131 | + </ul> |
| 132 | +</li> |
| 133 | +<li> |
| 134 | + Place both files in your local Maven repository: |
| 135 | + |
| 136 | + C:\Users\<user>\.m2\repository |
| 137 | + |
| 138 | +<li>Remove the script tag from the POM file. |
| 139 | + |
| 140 | +<li>Install manually: |
| 141 | +</ol> |
| 142 | + |
| 143 | +```powershell |
| 144 | +mvn install:install-file |
| 145 | + -Dfile="path\to\pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar" |
| 146 | + -DpomFile="path\to\pentaho-aggdesigner-algorithm-5.1.5-jhyde.pom" |
| 147 | +``` |
| 148 | +--- |
| 149 | + |
| 150 | +##Flink 1.12.0, 1.11.0 |
| 151 | + |
| 152 | +**Java:** 11.0.28 |
| 153 | +**Maven:** 3.8.6 |
| 154 | + |
| 155 | +Use: |
| 156 | + |
| 157 | +```powershell |
| 158 | +mvn clean install -DskipTests -Pskip-webui-build |
| 159 | +``` |
| 160 | + |
| 161 | +Apply the shaded-JAR and Pentaho workarounds from previous sections if needed. |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +##Flink 1.10.0 |
| 166 | + |
| 167 | +**Java:** 11.0.28 |
| 168 | +**Maven:** 3.8.6 |
| 169 | + |
| 170 | +This version may attempt to download:<br> |
| 171 | +```jms-1.1.jar```<br> |
| 172 | +via HTTP, which Maven 3.8.x blocks. |
| 173 | + |
| 174 | +###Workaround for JMS 1.1 |
| 175 | + |
| 176 | +Download: |
| 177 | + <ul> |
| 178 | + <li>https://repository.jboss.org/maven2/javax/jms/jms/1.1/jms-1.1.jar</li> |
| 179 | + <li>https://repository.jboss.org/maven2/javax/jms/jms/1.1/jms-1.1.pom</li> |
| 180 | + </ul> |
| 181 | + |
| 182 | +Place them in: |
| 183 | + |
| 184 | +```C:\Users\<user>\.m2\repository``` |
| 185 | + |
| 186 | + |
| 187 | +Then remove the script tag from the POM and install manually: |
| 188 | + |
| 189 | +```powershell mvn install:install-file |
| 190 | + -Dfile="path\to\jms-1.1.jar" |
| 191 | + -DpomFile="path\to\jms-1.1.pom" |
| 192 | +``` |
| 193 | + |
| 194 | + |
| 195 | +Build with: |
| 196 | + |
| 197 | +```powershell |
| 198 | +mvn clean install -DskipTests -Pskip-webui-build |
| 199 | +``` |
| 200 | + |
| 201 | +##Flink 1.9.0 |
| 202 | + |
| 203 | +**Java:** 1.8.0_202 |
| 204 | +**Maven:** 3.8.6 |
| 205 | + |
| 206 | +Older releases may require additional memory during compilation. |
| 207 | +Allocate more heap space before building: |
| 208 | + |
| 209 | +``` |
| 210 | +$env:MAVEN_OPTS="-Xmx2g -Xms1g -XX:MaxPermSize=512m -XX:+UseG1GC" |
| 211 | +``` |
| 212 | + |
| 213 | + |
| 214 | +Then: |
| 215 | + |
| 216 | +``` |
| 217 | +mvn clean install -DskipTests -Pskip-webui-build |
| 218 | +``` |
| 219 | + |
| 220 | +##Flink 1.8.0, 1.7.0, 1.6.0, 1.5.0, 1.4.0, 1.3.0 |
| 221 | + |
| 222 | +**Java:** 1.8.0_202 |
| 223 | +**Maven:** 3.8.6 |
| 224 | + |
| 225 | +These versions may require all workarounds listed earlier: |
| 226 | + |
| 227 | +<ul> |
| 228 | +<li>shaded-JAR hangs</li> |
| 229 | +<li>Pentaho dependency</li> |
| 230 | +<li>JMS dependency</li> |
| 231 | +<li>additional heap memory</li> |
| 232 | +</ul> |
| 233 | + |
| 234 | +Additionally, versions ≤ 1.8.0 may try to download: |
| 235 | + |
| 236 | +**maprfs-5.2.1-mapr (HTTP-only)** |
| 237 | + |
| 238 | +This dependency is no longer available and has many transitive dependencies. |
| 239 | +Skip this module instead of attempting manual installation. |
| 240 | + |
| 241 | +**confluent.io dependencies** |
| 242 | + |
| 243 | +These can still be downloaded after disabling Maven mirrors. |
| 244 | + |
| 245 | +Build using: |
| 246 | + |
| 247 | +```powershell |
| 248 | +mvn clean install -DskipTests -pl "!flink-filesystems/flink-mapr-fs" |
| 249 | +``` |
| 250 | + |
| 251 | +Flags: |
| 252 | + |
| 253 | +<ul> |
| 254 | +<li> -DskipTests — compiles but skips execution of tests</li> |
| 255 | + |
| 256 | +<li>-Pskip-webui-build — skips the Web UI build</li> |
| 257 | + |
| 258 | +<li>-pl "!flink-filesystems/flink-mapr-fs" — excludes MapR FS from the build</li> |
| 259 | +</ul> |
| 260 | + |
| 261 | +##Summary |
| 262 | + |
| 263 | +Building historical Flink releases on Windows may require: |
| 264 | + |
| 265 | +<ul> |
| 266 | +<li>selecting the correct Java version</li> |
| 267 | + |
| 268 | +<li>avoiding multi-threaded Maven builds for older versions</li> |
| 269 | + |
| 270 | +<li>manually installing legacy dependencies that no longer exist online</li> |
| 271 | + |
| 272 | +<li>allocating additional heap memory</li> |
| 273 | + |
| 274 | +<li>skipping the MapR filesystem module</li> |
| 275 | + |
| 276 | +<li>These instructions have been validated across all releases from 1.3.0 to 2.1.0.</li> |
| 277 | +</ul> |
| 278 | + |
| 279 | +If you encounter issues not covered here, consider checking your local Maven cache, ensuring path length limits are not exceeded, or reviewing the release-specific build notes available in the source distribution. |