@@ -79,6 +79,7 @@ flexible messaging model and an intuitive client API.</description>
79
79
<properties >
80
80
<maven .compiler.source>17</maven .compiler.source>
81
81
<maven .compiler.target>17</maven .compiler.target>
82
+ <pulsar .broker.compiler.release>${maven.compiler.target} </pulsar .broker.compiler.release>
82
83
<pulsar .client.compiler.release>8</pulsar .client.compiler.release>
83
84
84
85
<!-- config keys to configure test selection -->
@@ -90,7 +91,12 @@ flexible messaging model and an intuitive client API.</description>
90
91
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
91
92
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
92
93
<redirectTestOutputToFile >true</redirectTestOutputToFile >
93
- <test .additional.args></test .additional.args>
94
+ <!-- required for running tests on JDK11+ -->
95
+ <test .additional.args>
96
+ --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
97
+ --add-opens java.base/java.lang=ALL-UNNAMED <!-- Mockito-->
98
+ --add-opens java.base/java.io=ALL-UNNAMED <!-- Bookkeeper NativeIO -->
99
+ </test .additional.args>
94
100
<testReuseFork >true</testReuseFork >
95
101
<testForkCount >4</testForkCount >
96
102
<testRealAWS >false</testRealAWS >
@@ -238,13 +244,13 @@ flexible messaging model and an intuitive client API.</description>
238
244
<exec-maven-plugin .version>3.0.0</exec-maven-plugin .version>
239
245
<license-maven-plugin .version>4.0.rc2</license-maven-plugin .version>
240
246
<directory-maven-plugin .version>1.0</directory-maven-plugin .version>
241
- <maven-enforcer-plugin .version>3.0.0-M3 </maven-enforcer-plugin .version>
247
+ <maven-enforcer-plugin .version>3.0.0</maven-enforcer-plugin .version>
242
248
<!-- surefire.version is defined in apache parent pom -->
243
249
<!-- it is used for surefire, failsafe and surefire-report plugins -->
244
250
<!-- do not upgrade surefire.version to 3.0.0-M5 since it runs slowly and breaks tests. -->
245
251
<surefire .version>3.0.0-M3</surefire .version>
246
252
<maven-assembly-plugin .version>3.3.0</maven-assembly-plugin .version>
247
- <maven-compiler-plugin .version>3.9.0 </maven-compiler-plugin .version>
253
+ <maven-compiler-plugin .version>3.10.1 </maven-compiler-plugin .version>
248
254
<maven-dependency-plugin .version>3.1.2</maven-dependency-plugin .version>
249
255
<maven-modernizer-plugin .version>2.3.0</maven-modernizer-plugin .version>
250
256
<maven-shade-plugin >3.3.0</maven-shade-plugin >
@@ -1703,10 +1709,11 @@ flexible messaging model and an intuitive client API.</description>
1703
1709
<configuration >
1704
1710
<rules >
1705
1711
<requireJavaVersion >
1706
- <version >[1.8.0,)</version >
1712
+ <version >17</version >
1713
+ <message >Java 17+ is required to build Pulsar.</message >
1707
1714
</requireJavaVersion >
1708
1715
<requireMavenVersion >
1709
- <version >[3.3.9,) </version >
1716
+ <version >3.6.1 </version >
1710
1717
</requireMavenVersion >
1711
1718
</rules >
1712
1719
</configuration >
@@ -1749,6 +1756,9 @@ flexible messaging model and an intuitive client API.</description>
1749
1756
<groupId >org.apache.maven.plugins</groupId >
1750
1757
<artifactId >maven-compiler-plugin</artifactId >
1751
1758
<version >${maven-compiler-plugin.version} </version >
1759
+ <configuration >
1760
+ <release >${pulsar.broker.compiler.release} </release >
1761
+ </configuration >
1752
1762
</plugin >
1753
1763
<plugin >
1754
1764
<groupId >org.gaul</groupId >
@@ -1878,35 +1888,18 @@ flexible messaging model and an intuitive client API.</description>
1878
1888
1879
1889
<profiles >
1880
1890
<profile >
1881
- <id >jdk11</id >
1891
+ <!-- used for running integration tests on Java 8 -->
1892
+ <id >integration-test-java8</id >
1882
1893
<activation >
1883
- <jdk >[11,) </jdk >
1894
+ <jdk >1.8 </jdk >
1884
1895
</activation >
1885
1896
<properties >
1886
- <!-- prevents silent NoSuchMethodErrors that happen at runtime on Java 8 -->
1887
- <!-- see https://github.com/apache/pulsar/issues/8445 -->
1888
- <maven .compiler.release>${maven.compiler.target} </maven .compiler.release>
1889
- <!-- required for running tests on JDK11+ -->
1890
- <test .additional.args>
1891
- --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
1892
- --add-opens java.base/java.lang=ALL-UNNAMED <!-- Mockito-->
1893
- --add-opens java.base/java.io=ALL-UNNAMED <!-- Bookkeeper NativeIO -->
1894
- </test .additional.args>
1897
+ <test .additional.args/>
1898
+ <maven .compiler.source>8</maven .compiler.source>
1899
+ <maven .compiler.target>8</maven .compiler.target>
1900
+ <pulsar .broker.compiler.release></pulsar .broker.compiler.release>
1901
+ <pulsar .client.compiler.release></pulsar .client.compiler.release>
1895
1902
</properties >
1896
- <build >
1897
- <pluginManagement >
1898
- <plugins >
1899
- <plugin >
1900
- <groupId >org.apache.maven.plugins</groupId >
1901
- <artifactId >maven-compiler-plugin</artifactId >
1902
- <configuration >
1903
- <!-- for some reason, setting maven.compiler.release property alone doesn't work -->
1904
- <release >${maven.compiler.release} </release >
1905
- </configuration >
1906
- </plugin >
1907
- </plugins >
1908
- </pluginManagement >
1909
- </build >
1910
1903
</profile >
1911
1904
<profile >
1912
1905
<id >coverage</id >
@@ -2169,21 +2162,18 @@ flexible messaging model and an intuitive client API.</description>
2169
2162
<!--
2170
2163
Configure Google Error Prone static code analyser, http://errorprone.info
2171
2164
2172
- consists of 3 maven profiles: errorprone, errorprone-jdk8 and errorprone-jdk11
2173
-
2174
2165
usage:
2175
- activate profiles "errorprone" and either "errorprone-jdk8" or "errorprone-jdk11"
2176
- depending on the JVM version
2166
+ activate profile "errorprone"
2177
2167
2178
2168
It is required to add "lombok.addJavaxGeneratedAnnotation = true" to lombok.config
2179
2169
temporarily before running the analysis.
2180
2170
2181
2171
usage example:
2182
2172
echo lombok.addJavaxGeneratedAnnotation=true >> lombok.config
2183
- mvn -Perrorprone,errorprone-jdk11, main compile
2173
+ mvn -Perrorprone,main compile
2184
2174
2185
2175
Revisiting warnings and errors is possible in IntelliJ after activating
2186
- errorprone, errorprone-jdk11 and main in "Maven->Profiles" and choosing
2176
+ errorprone and main in "Maven->Profiles" and choosing
2187
2177
"Build->Rebuild Project"
2188
2178
Compiling all Pulsar projects in IntelliJ requires some manual tweaks to get the
2189
2179
shaded projects to pass compilation. In some cases, it's better to mark the project
@@ -2208,7 +2198,7 @@ flexible messaging model and an intuitive client API.</description>
2208
2198
<arg >-Xlint:-options</arg >
2209
2199
<!-- configure Error Prone . Disable some checks that crash the compiler or are annoying -->
2210
2200
<!-- the following argument must be kept on one line when building with JDK8 -->
2211
- <arg >-Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-sources/.* -XepDisableWarningsInGeneratedCode -Xep:UnusedVariable:OFF -Xep:FallThrough:OFF -Xep:OverrideThrowableToString:OFF -Xep:UnusedMethod:OFF -Xep:StringSplitter:OFF -Xep:CanonicalDuration:OFF ${errorprone.arguments.jdk11} </arg >
2201
+ <arg >-Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-sources/.* -XepDisableWarningsInGeneratedCode -Xep:UnusedVariable:OFF -Xep:FallThrough:OFF -Xep:OverrideThrowableToString:OFF -Xep:UnusedMethod:OFF -Xep:StringSplitter:OFF -Xep:CanonicalDuration:OFF -Xep:Slf4jDoNotLogMessageOfExceptionExplicitly:WARN -Xep:Slf4jSignOnlyFormat:WARN -Xep:Slf4jFormatShouldBeConst:WARN -Xep:Slf4jLoggerShouldBePrivate:WARN -Xep:Slf4jLoggerShouldBeNonStatic:OFF </arg >
2212
2202
</compilerArgs >
2213
2203
<annotationProcessorPaths combine.children=" append" >
2214
2204
<path >
@@ -2221,53 +2211,8 @@ flexible messaging model and an intuitive client API.</description>
2221
2211
<artifactId >mockito-errorprone</artifactId >
2222
2212
<version >${mockito.version} </version >
2223
2213
</path >
2224
- </annotationProcessorPaths >
2225
- </configuration >
2226
- </plugin >
2227
- </plugins >
2228
- </build >
2229
- </profile >
2230
- <!-- running errorprone on JDK 8 requires special javac configuration -->
2231
- <profile >
2232
- <id >errorprone-jdk8</id >
2233
- <build >
2234
- <plugins >
2235
- <plugin >
2236
- <groupId >org.apache.maven.plugins</groupId >
2237
- <artifactId >maven-compiler-plugin</artifactId >
2238
- <configuration >
2239
- <compilerArgs combine.children=" append" >
2240
- <arg >
2241
- -J-Xbootclasspath/p:${settings.localRepository} /com/google/errorprone/javac/${errorprone.javac.version} /javac-${errorprone.javac.version} .jar</arg >
2242
- </compilerArgs >
2243
- <annotationProcessorPaths combine.children=" append" >
2244
- <path >
2245
- <groupId >com.google.errorprone</groupId >
2246
- <artifactId >javac</artifactId >
2247
- <version >${errorprone.javac.version} </version >
2248
- </path >
2249
- </annotationProcessorPaths >
2250
- </configuration >
2251
- </plugin >
2252
- </plugins >
2253
- </build >
2254
- </profile >
2255
- <profile >
2256
- <id >errorprone-jdk11</id >
2257
- <properties >
2258
- <!-- pass the additional properties to -Xplugin:ErrorProne argument defined in errorprone profile -->
2259
- <!-- change configuration of slf4j checks to be more permissive -->
2260
- <errorprone .arguments.jdk11>-Xep:Slf4jDoNotLogMessageOfExceptionExplicitly:WARN -Xep:Slf4jSignOnlyFormat:WARN -Xep:Slf4jFormatShouldBeConst:WARN -Xep:Slf4jLoggerShouldBePrivate:WARN -Xep:Slf4jLoggerShouldBeNonStatic:OFF</errorprone .arguments.jdk11>
2261
- </properties >
2262
- <build >
2263
- <plugins >
2264
- <plugin >
2265
- <groupId >org.apache.maven.plugins</groupId >
2266
- <artifactId >maven-compiler-plugin</artifactId >
2267
- <configuration >
2268
- <annotationProcessorPaths combine.children=" append" >
2269
2214
<!-- add https://github.com/KengoTODA/errorprone-slf4j Error Prone plugin -->
2270
- <!-- detects slf4j misusage. Doesn't run on Java 8, so this is why it's in the errorprone-jdk11 profile -->
2215
+ <!-- detects slf4j misusage. -->
2271
2216
<path >
2272
2217
<groupId >jp.skypencil.errorprone.slf4j</groupId >
2273
2218
<artifactId >errorprone-slf4j</artifactId >
0 commit comments