|
13 | 13 | <url>https://github.com/google/guava</url>
|
14 | 14 | <properties>
|
15 | 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. |
| 16 | + When building Guava, you can pass (e.g.) `-Dsurefire.toolchain.version=21` to change which version to run tests under. |
| 17 | + You may find that you need to use Java 11+ to *build* Guava, but it continues to work under Java 8, and you can run tests to verify that, as we do. |
19 | 18 | -->
|
20 | 19 | <surefire.toolchain.version>${java.specification.version}</surefire.toolchain.version>
|
21 | 20 | <!-- Override this with -Dtest.include="**/SomeTest.java" on the CLI -->
|
|
28 | 27 | <maven-javadoc-plugin.additionalJOptions></maven-javadoc-plugin.additionalJOptions>
|
29 | 28 | <project.build.outputTimestamp>2024-01-02T00:00:00Z</project.build.outputTimestamp>
|
30 | 29 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
31 |
| - <test.add.opens></test.add.opens> |
| 30 | + <!-- |
| 31 | + Some tests need reflective access to the internals of these packages. It is only the |
| 32 | + tests themselves and not the code being tested that needs that access, though there's no |
| 33 | + obvious way to ensure that. |
| 34 | +
|
| 35 | + We could consider arranging things so that only the tests we know need this would get |
| 36 | + the add-opens. Right now that doesn't seem worth the effort, though. |
| 37 | + --> |
| 38 | + <test.add.opens> |
| 39 | + --add-opens java.base/java.lang=ALL-UNNAMED |
| 40 | + --add-opens java.base/java.util=ALL-UNNAMED |
| 41 | + --add-opens java.base/sun.security.jca=ALL-UNNAMED |
| 42 | + </test.add.opens> |
32 | 43 | <test.add.args></test.add.args>
|
33 | 44 | <module.status>integration</module.status>
|
34 | 45 | <variant.jvmEnvironment>android</variant.jvmEnvironment>
|
|
321 | 332 | <artifactId>maven-javadoc-plugin</artifactId>
|
322 | 333 | <version>3.11.1</version>
|
323 | 334 | <configuration>
|
324 |
| - <!-- 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). --> |
| 335 | + <!-- TODO: b/286965322 - Use a newer version (probably the default javac 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). At that point, we'll likely want to remove the no-module-directories additionalJOption, as documented below. --> |
325 | 336 | <jdkToolchain>
|
326 | 337 | <version>11</version>
|
327 | 338 | <vendor>zulu</vendor>
|
|
337 | 348 | </additionalOptions>
|
338 | 349 | <linksource>true</linksource>
|
339 | 350 | <source>8</source>
|
340 |
| - <additionalJOption>${maven-javadoc-plugin.additionalJOptions}</additionalJOption> |
| 351 | + <!-- |
| 352 | + Required to make symbol search work correctly in the generated pages under JDK 11-12. |
| 353 | +
|
| 354 | + This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582). |
| 355 | +
|
| 356 | + Consider removing it once our Javadoc generation is migrated to a recent JDK. |
| 357 | + --> |
| 358 | + <additionalJOption>--no-module-directories</additionalJOption> |
341 | 359 | </configuration>
|
342 | 360 | <executions>
|
343 | 361 | <execution>
|
|
448 | 466 | </dependencyManagement>
|
449 | 467 | <profiles>
|
450 | 468 | <profile>
|
451 |
| - <id>sonatype-oss-release</id> |
452 |
| - <build> |
453 |
| - <plugins> |
454 |
| - <plugin> |
455 |
| - <artifactId>maven-gpg-plugin</artifactId> |
456 |
| - <version>3.0.1</version> |
457 |
| - <executions> |
458 |
| - <execution> |
459 |
| - <id>sign-artifacts</id> |
460 |
| - <phase>verify</phase> |
461 |
| - <goals> |
462 |
| - <goal>sign</goal> |
463 |
| - </goals> |
464 |
| - </execution> |
465 |
| - </executions> |
466 |
| - </plugin> |
467 |
| - </plugins> |
| 469 | + <id>sonatype-oss-release</id> |
| 470 | + <build> |
| 471 | + <plugins> |
| 472 | + <plugin> |
| 473 | + <artifactId>maven-gpg-plugin</artifactId> |
| 474 | + <version>3.0.1</version> |
| 475 | + <executions> |
| 476 | + <execution> |
| 477 | + <id>sign-artifacts</id> |
| 478 | + <phase>verify</phase> |
| 479 | + <goals> |
| 480 | + <goal>sign</goal> |
| 481 | + </goals> |
| 482 | + </execution> |
| 483 | + </executions> |
| 484 | + </plugin> |
| 485 | + </plugins> |
468 | 486 | </build>
|
469 | 487 | </profile>
|
470 | 488 | <profile>
|
471 |
| - <!-- |
472 |
| - Passes JDK 11-12-specific `no-module-directories` flag to Javadoc tool, |
473 |
| - which is required to make symbol search work correctly in the generated |
474 |
| - pages. |
475 |
| -
|
476 |
| - This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582). |
477 |
| -
|
478 |
| - Consider removing it once our release and test scripts are migrated to a recent JDK (17+). |
479 |
| - --> |
480 |
| - <id>javadocs-jdk11-12</id> |
| 489 | + <id>suppress-open-jre-modules-for-toolchain-1.8</id> |
481 | 490 | <activation>
|
482 |
| - <jdk>[11,13)</jdk> |
| 491 | + <property> |
| 492 | + <name>surefire.toolchain.version</name> |
| 493 | + <!-- the value provided by java.specification.version --> |
| 494 | + <value>1.8</value> |
| 495 | + </property> |
483 | 496 | </activation>
|
484 | 497 | <properties>
|
485 |
| - <maven-javadoc-plugin.additionalJOptions>--no-module-directories</maven-javadoc-plugin.additionalJOptions> |
| 498 | + <test.add.opens></test.add.opens> |
486 | 499 | </properties>
|
487 | 500 | </profile>
|
488 | 501 | <profile>
|
489 |
| - <id>open-jre-modules</id> |
| 502 | + <id>suppress-open-jre-modules-for-toolchain-8</id> |
490 | 503 | <activation>
|
491 |
| - <jdk>[9,]</jdk> |
| 504 | + <property> |
| 505 | + <name>surefire.toolchain.version</name> |
| 506 | + <!-- the value provided by GitHub CI (which maybe we could even change, but supporting "8" seems nice for any users who try pass that value manually) --> |
| 507 | + <value>8</value> |
| 508 | + </property> |
492 | 509 | </activation>
|
493 | 510 | <properties>
|
494 |
| - <!-- |
495 |
| - Some tests need reflective access to the internals of these packages. It is only the |
496 |
| - tests themselves and not the code being tested that needs that access, though there's no |
497 |
| - obvious way to ensure that. |
498 |
| -
|
499 |
| - We could consider arranging things so that only the tests we know need this would get |
500 |
| - the add-opens. Right now that doesn't seem worth the effort, though. |
501 |
| - --> |
502 |
| - <test.add.opens> |
503 |
| - --add-opens java.base/java.lang=ALL-UNNAMED |
504 |
| - --add-opens java.base/java.util=ALL-UNNAMED |
505 |
| - --add-opens java.base/sun.security.jca=ALL-UNNAMED |
506 |
| - </test.add.opens> |
| 511 | + <test.add.opens></test.add.opens> |
507 | 512 | </properties>
|
508 | 513 | </profile>
|
| 514 | + <!-- The Gradle integration tests need to set JAVA_HOME to the location of Java 11. The following profile extracts that location. --> |
509 | 515 | <profile>
|
510 |
| - <id>javac-for-jvm18plus</id> |
511 |
| - <activation> |
512 |
| - <!-- |
513 |
| - In order to build and run the tests against JDK 18+, we need to pass java.security.manager=allow, to make |
514 |
| - the deprecated 'java.lang.SecurityManager' available for use. |
515 |
| - --> |
516 |
| - <jdk>[18,]</jdk> |
517 |
| - </activation> |
518 |
| - <properties> |
519 |
| - <test.add.args>-Djava.security.manager=allow</test.add.args> |
520 |
| - </properties> |
| 516 | + <id>print-java-11-home</id> |
| 517 | + <build> |
| 518 | + <plugins> |
| 519 | + <plugin> |
| 520 | + <artifactId>maven-toolchains-plugin</artifactId> |
| 521 | + <executions> |
| 522 | + <execution> |
| 523 | + <id>select-java-11</id> |
| 524 | + <phase>initialize</phase> |
| 525 | + <goals> |
| 526 | + <goal>toolchain</goal> |
| 527 | + </goals> |
| 528 | + </execution> |
| 529 | + </executions> |
| 530 | + <configuration> |
| 531 | + <toolchains> |
| 532 | + <jdk> |
| 533 | + <version>11</version> |
| 534 | + <vendor>zulu</vendor> |
| 535 | + </jdk> |
| 536 | + </toolchains> |
| 537 | + </configuration> |
| 538 | + </plugin> |
| 539 | + <plugin> |
| 540 | + <groupId>com.diamondq.maven</groupId> |
| 541 | + <artifactId>javahome-resolver-maven-plugin</artifactId> |
| 542 | + <version>1.0.2</version> |
| 543 | + <executions> |
| 544 | + <execution> |
| 545 | + <id>resolve-java-11</id> |
| 546 | + <phase>initialize</phase> |
| 547 | + <goals> |
| 548 | + <goal>resolve</goal> |
| 549 | + </goals> |
| 550 | + </execution> |
| 551 | + </executions> |
| 552 | + </plugin> |
| 553 | + <plugin> |
| 554 | + <groupId>org.codehaus.mojo</groupId> |
| 555 | + <artifactId>exec-maven-plugin</artifactId> |
| 556 | + <version>3.5.0</version> |
| 557 | + <executions> |
| 558 | + <execution> |
| 559 | + <id>print-java-11-home</id> |
| 560 | + <phase>initialize</phase> |
| 561 | + <goals> |
| 562 | + <goal>exec</goal> |
| 563 | + </goals> |
| 564 | + <configuration> |
| 565 | + <executable>echo</executable> |
| 566 | + <arguments> |
| 567 | + <argument>${javaHome}</argument> |
| 568 | + </arguments> |
| 569 | + <outputFile>${project.build.directory}/java_11_home</outputFile> |
| 570 | + </configuration> |
| 571 | + </execution> |
| 572 | + </executions> |
| 573 | + </plugin> |
| 574 | + </plugins> |
| 575 | + </build> |
521 | 576 | </profile>
|
522 | 577 | </profiles>
|
523 | 578 | </project>
|
0 commit comments