|
12 | 12 | <description>Parent for guava artifacts</description>
|
13 | 13 | <url>https://github.com/google/guava</url>
|
14 | 14 | <properties>
|
| 15 | + <!-- |
| 16 | + We could override this to change which version we run tests under. |
| 17 | + However, I think that our -Djava.security.manager=allow profile is based on the *Maven* JDK. |
| 18 | + If we want to use overrides here, we should change that profile to also be based on surefire.toolchain.version. |
| 19 | + --> |
| 20 | + <surefire.toolchain.version>${java.specification.version}</surefire.toolchain.version> |
15 | 21 | <!-- Override this with -Dtest.include="**/SomeTest.java" on the CLI -->
|
16 | 22 | <test.include>%regex[.*.class]</test.include>
|
17 | 23 | <truth.version>1.4.4</truth.version>
|
18 | 24 | <jsr305.version>3.0.2</jsr305.version>
|
19 | 25 | <checker.version>3.43.0</checker.version>
|
20 | 26 | <errorprone.version>2.28.0</errorprone.version>
|
21 | 27 | <j2objc.version>3.0.0</j2objc.version>
|
22 |
| - <javac.version>9+181-r4173-1</javac.version> |
23 | 28 | <!-- Empty for all JDKs but 9-12 -->
|
24 | 29 | <maven-javadoc-plugin.additionalJOptions></maven-javadoc-plugin.additionalJOptions>
|
25 | 30 | <project.build.outputTimestamp>2024-01-02T00:00:00Z</project.build.outputTimestamp>
|
|
122 | 127 | <plugins>
|
123 | 128 | <plugin>
|
124 | 129 | <artifactId>maven-compiler-plugin</artifactId>
|
125 |
| - <version>3.8.1</version> |
| 130 | + <version>3.13.0</version> |
126 | 131 | <configuration>
|
127 | 132 | <source>1.8</source>
|
128 | 133 | <target>1.8</target>
|
|
139 | 144 | <arg>doesnotexist</arg>
|
140 | 145 | <!-- https://errorprone.info/docs/installation#maven -->
|
141 | 146 | <arg>-XDcompilePolicy=simple</arg>
|
142 |
| - <!-- -Xplugin:ErrorProne is set conditionally by a profile. --> |
| 147 | + |
| 148 | + <!-- https://errorprone.info/docs/installation#maven --> |
| 149 | + <!-- TODO(cpovirk): Enable NullArgumentForNonNullParameter for |
| 150 | + prod code. It's disabled automatically for "test code" |
| 151 | + (which is good: our tests have intentional violations), but |
| 152 | + Error Prone doesn't know it's building test code unless we |
| 153 | + pass -XepCompilingTestOnlyCode, and that argument needs to |
| 154 | + be passed as part of the same <arg> as -Xplugin:ErrorProne, |
| 155 | + and I gave up trying to figure out how to do that for test |
| 156 | + compilation only. --> |
| 157 | + <arg>-Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF -Xep:Java8ApiChecker:ERROR</arg> |
| 158 | + <!-- https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md#jdk-16 --> |
| 159 | + <!-- TODO(cpovirk): Use .mvn/jvm.config instead (per |
| 160 | + https://errorprone.info/docs/installation#maven) if it can |
| 161 | + be made not to interfere with JDK8 or if we stop building |
| 162 | + with JDK8. --> |
| 163 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> |
| 164 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> |
| 165 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> |
| 166 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> |
| 167 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> |
| 168 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> |
| 169 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> |
| 170 | + <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> |
| 171 | + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> |
| 172 | + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> |
143 | 173 | </compilerArgs>
|
144 | 174 | <annotationProcessorPaths>
|
145 | 175 | <path>
|
|
157 | 187 | <fork>true</fork>
|
158 | 188 | </configuration>
|
159 | 189 | </plugin>
|
| 190 | + <plugin> |
| 191 | + <groupId>org.mvnsearch</groupId> |
| 192 | + <artifactId>toolchains-maven-plugin</artifactId> |
| 193 | + <version>4.5.0</version> |
| 194 | + <executions> |
| 195 | + <!-- |
| 196 | + We can apparently have only one <jdk> per execution: Others are silently ignored :( |
| 197 | + To properly test this, you need to remove existing toolchains: |
| 198 | + rm -rf ~/.m2/jdks/ ~/.m2/toolchains.xml |
| 199 | + (But don't run that if you have put something into ~/.m2/toolchains.xml yourself.) |
| 200 | + --> |
| 201 | + <execution> |
| 202 | + <id>download-11</id> |
| 203 | + <goals> |
| 204 | + <goal>toolchain</goal> |
| 205 | + </goals> |
| 206 | + <configuration> |
| 207 | + <toolchains> |
| 208 | + <jdk> |
| 209 | + <version>11</version> |
| 210 | + <vendor>zulu</vendor> |
| 211 | + </jdk> |
| 212 | + </toolchains> |
| 213 | + </configuration> |
| 214 | + </execution> |
| 215 | + <execution> |
| 216 | + <id>download-22-and-surefire-version</id> |
| 217 | + <goals> |
| 218 | + <goal>toolchain</goal> |
| 219 | + </goals> |
| 220 | + <configuration> |
| 221 | + <toolchains> |
| 222 | + <jdk> |
| 223 | + <version>22</version> |
| 224 | + <vendor>zulu</vendor> |
| 225 | + </jdk> |
| 226 | + <testJdk> |
| 227 | + <version>${surefire.toolchain.version}</version> |
| 228 | + <vendor>zulu</vendor> |
| 229 | + </testJdk> |
| 230 | + </toolchains> |
| 231 | + </configuration> |
| 232 | + </execution> |
| 233 | + </executions> |
| 234 | + </plugin> |
| 235 | + <plugin> |
| 236 | + <artifactId>maven-toolchains-plugin</artifactId> |
| 237 | + <version>3.2.0</version> |
| 238 | + <executions> |
| 239 | + <execution> |
| 240 | + <goals> |
| 241 | + <goal>toolchain</goal> |
| 242 | + </goals> |
| 243 | + </execution> |
| 244 | + </executions> |
| 245 | + <configuration> |
| 246 | + <toolchains> |
| 247 | + <jdk> |
| 248 | + <version>22</version> |
| 249 | + <vendor>zulu</vendor> |
| 250 | + </jdk> |
| 251 | + </toolchains> |
| 252 | + </configuration> |
| 253 | + </plugin> |
160 | 254 | <plugin>
|
161 | 255 | <artifactId>maven-jar-plugin</artifactId>
|
162 | 256 | <version>3.2.0</version>
|
|
176 | 270 | <dependency>
|
177 | 271 | <groupId>org.codehaus.plexus</groupId>
|
178 | 272 | <artifactId>plexus-io</artifactId>
|
179 |
| - <!-- DO NOT UPGRADE this past 3.4.1 until https://github.com/codehaus-plexus/plexus-io/issues/109 is fixed. --> |
| 273 | + <!-- DO NOT UPGRADE this past 3.4.1 until https://github.com/codehaus-plexus/plexus-io/issues/109 is fixed (probably in 3.5.1). --> |
180 | 274 | <version>3.4.1</version>
|
181 | 275 | </dependency>
|
182 | 276 | </dependencies>
|
|
219 | 313 | </plugin>
|
220 | 314 | <plugin>
|
221 | 315 | <artifactId>maven-javadoc-plugin</artifactId>
|
222 |
| - <version>3.5.0</version> |
| 316 | + <version>3.8.0</version> |
223 | 317 | <configuration>
|
| 318 | + <!-- TODO: b/286965322 - Use a newer version (probably the default toolchain we set up?) if it doesn't break Javadoc (including causing trouble for our later run of JDiff, which we do outside Maven, during snapshots/releases). --> |
| 319 | + <jdkToolchain> |
| 320 | + <version>11</version> |
| 321 | + <vendor>zulu</vendor> |
| 322 | + </jdkToolchain> |
224 | 323 | <quiet>true</quiet>
|
225 | 324 | <notimestamp>true</notimestamp>
|
226 | 325 | <encoding>UTF-8</encoding>
|
|
231 | 330 | <additionalOption>-Xdoclint:-html</additionalOption>
|
232 | 331 | </additionalOptions>
|
233 | 332 | <linksource>true</linksource>
|
234 |
| - <source>${java.specification.version}</source> |
235 | 333 | <additionalJOption>${maven-javadoc-plugin.additionalJOptions}</additionalJOption>
|
236 | 334 | </configuration>
|
237 | 335 | <executions>
|
|
251 | 349 | </plugin>
|
252 | 350 | <plugin>
|
253 | 351 | <artifactId>maven-surefire-plugin</artifactId>
|
254 |
| - <version>2.7.2</version> |
| 352 | + <version>3.3.1</version> |
255 | 353 | <configuration>
|
| 354 | + <jdkToolchain> |
| 355 | + <version>${surefire.toolchain.version}</version> |
| 356 | + <vendor>zulu</vendor> |
| 357 | + </jdkToolchain> |
256 | 358 | <includes>
|
257 | 359 | <include>${test.include}</include>
|
258 | 360 | </includes>
|
|
394 | 496 | </test.add.opens>
|
395 | 497 | </properties>
|
396 | 498 | </profile>
|
397 |
| - <profile> |
398 |
| - <id>javac9-for-jdk8</id> |
399 |
| - <activation> |
400 |
| - <jdk>1.8</jdk> |
401 |
| - </activation> |
402 |
| - <build> |
403 |
| - <plugins> |
404 |
| - <plugin> |
405 |
| - <artifactId>maven-compiler-plugin</artifactId> |
406 |
| - <configuration> |
407 |
| - <!-- Under JDK8, we continue to use errorprone's javac9 (even |
408 |
| - though we don't run Error Prone itself, which no longer |
409 |
| - supports JDK8!). |
410 |
| -
|
411 |
| - Why? At some point, presumably after |
412 |
| - https://github.com/google/guava/commit/e06a8cec65815599e510d7f9c1ea9d2a8eaa438a, |
413 |
| - builds with JDK8 began failing animal-sniffer with the error: |
414 |
| -
|
415 |
| - Failed to check signatures: Bad class file .../CollectionFuture$ListFuture.class |
416 |
| -
|
417 |
| - One way of dealing with that would be to disable |
418 |
| - animal-sniffer. And that would be fine for our -jre builds: |
419 |
| - If we're building with JDK8, then clearly we're sticking to |
420 |
| - JDK8 APIs. However, I assume (but did not confirm) that we'd |
421 |
| - have the same issue with our -android builds, which need |
422 |
| - animal-sniffer so that they can check that we're sticking to |
423 |
| - JDK6-like APIs. |
424 |
| -
|
425 |
| - So instead, we use javac9, which doesn't lead to this error. |
426 |
| - --> |
427 |
| - <compilerArgs combine.children="append"> |
428 |
| - <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg> |
429 |
| - </compilerArgs> |
430 |
| - </configuration> |
431 |
| - </plugin> |
432 |
| - </plugins> |
433 |
| - </build> |
434 |
| - </profile> |
435 |
| - <profile> |
436 |
| - <id>run-error-prone</id> |
437 |
| - <activation> |
438 |
| - <!-- |
439 |
| - Error Prone requires 11+: https://errorprone.info/docs/installation |
440 |
| - We skip 12-15 because of https://github.com/google/error-prone/issues/3540. |
441 |
| - --> |
442 |
| - <jdk>[11,12),[16,)</jdk> |
443 |
| - </activation> |
444 |
| - <build> |
445 |
| - <plugins> |
446 |
| - <plugin> |
447 |
| - <artifactId>maven-compiler-plugin</artifactId> |
448 |
| - <configuration> |
449 |
| - <compilerArgs combine.children="append"> |
450 |
| - <!-- https://errorprone.info/docs/installation#maven --> |
451 |
| - <!-- TODO(cpovirk): Enable NullArgumentForNonNullParameter for |
452 |
| - prod code. It's disabled automatically for "test code" |
453 |
| - (which is good: our tests have intentional violations), but |
454 |
| - Error Prone doesn't know it's building test code unless we |
455 |
| - pass -XepCompilingTestOnlyCode, and that argument needs to |
456 |
| - be passed as part of the same <arg> as -Xplugin:ErrorProne, |
457 |
| - and I gave up trying to figure out how to do that for test |
458 |
| - compilation only. --> |
459 |
| - <arg>-Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF -Xep:Java8ApiChecker:ERROR</arg> |
460 |
| - <!-- https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md#jdk-16 --> |
461 |
| - <!-- TODO(cpovirk): Use .mvn/jvm.config instead (per |
462 |
| - https://errorprone.info/docs/installation#maven) if it can |
463 |
| - be made not to interfere with JDK8 or if we stop building |
464 |
| - with JDK8. --> |
465 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> |
466 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> |
467 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> |
468 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> |
469 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> |
470 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> |
471 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> |
472 |
| - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> |
473 |
| - <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> |
474 |
| - <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> |
475 |
| - </compilerArgs> |
476 |
| - </configuration> |
477 |
| - </plugin> |
478 |
| - </plugins> |
479 |
| - </build> |
480 |
| - </profile> |
481 | 499 | <profile>
|
482 | 500 | <id>javac-for-jvm18plus</id>
|
483 | 501 | <activation>
|
|
0 commit comments