1<?xml version="1.0" encoding="UTF-8"?> 2<project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 5 6 <modelVersion>4.0.0</modelVersion> 7 <groupId>com.google.guava</groupId> 8 <artifactId>guava-parent</artifactId> 9 <version>32.1.2-android</version> 10 <packaging>pom</packaging> 11 <name>Guava Maven Parent</name> 12 <description>Parent for guava artifacts</description> 13 <url>https://github.com/google/guava</url> 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> 21 <!-- Override this with -Dtest.include="**/SomeTest.java" on the CLI --> 22 <test.include>%regex[.*.class]</test.include> 23 <truth.version>1.4.4</truth.version> 24 <jsr305.version>3.0.2</jsr305.version> 25 <checker.version>3.43.0</checker.version> 26 <errorprone.version>2.28.0</errorprone.version> 27 <j2objc.version>3.0.0</j2objc.version> 28 <!-- Empty for all JDKs but 9-12 --> 29 <maven-javadoc-plugin.additionalJOptions></maven-javadoc-plugin.additionalJOptions> 30 <project.build.outputTimestamp>2024-01-02T00:00:00Z</project.build.outputTimestamp> 31 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 32 <test.add.opens></test.add.opens> 33 <test.add.args></test.add.args> 34 <module.status>integration</module.status> 35 <variant.jvmEnvironment>android</variant.jvmEnvironment> 36 <variant.jvmEnvironmentVariantName>android</variant.jvmEnvironmentVariantName> 37 <otherVariant.version>32.1.2-jre</otherVariant.version> 38 <otherVariant.jvmEnvironment>standard-jvm</otherVariant.jvmEnvironment> 39 <otherVariant.jvmEnvironmentVariantName>jre</otherVariant.jvmEnvironmentVariantName> 40 </properties> 41 <issueManagement> 42 <system>GitHub Issues</system> 43 <url>https://github.com/google/guava/issues</url> 44 </issueManagement> 45 <inceptionYear>2010</inceptionYear> 46 <licenses> 47 <license> 48 <name>Apache License, Version 2.0</name> 49 <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> 50 <distribution>repo</distribution> 51 </license> 52 </licenses> 53 <scm> 54 <connection>scm:git:https://github.com/google/guava.git</connection> 55 <developerConnection>scm:git:[email protected]:google/guava.git</developerConnection> 56 <url>https://github.com/google/guava</url> 57 </scm> 58 <developers> 59 <developer> 60 <id>kevinb9n</id> 61 <name>Kevin Bourrillion</name> 62 <email>[email protected]</email> 63 <organization>Google</organization> 64 <organizationUrl>http://www.google.com</organizationUrl> 65 <roles> 66 <role>owner</role> 67 <role>developer</role> 68 </roles> 69 <timezone>-8</timezone> 70 </developer> 71 </developers> 72 <ciManagement> 73 <system>GitHub Actions</system> 74 <url>https://github.com/google/guava/actions</url> 75 </ciManagement> 76 <modules> 77 <module>guava</module> 78 <module>guava-bom</module> 79 <module>guava-testlib</module> 80 <module>guava-tests</module> 81 </modules> 82 <build> 83 <!-- Handle where Guava deviates from Maven defaults --> 84 <sourceDirectory>src</sourceDirectory> 85 <testSourceDirectory>test</testSourceDirectory> 86 <resources> 87 <resource> 88 <directory>../..</directory> 89 <includes> 90 <include>LICENSE</include> 91 </includes> 92 <targetPath>META-INF</targetPath> 93 </resource> 94 </resources> 95 <testResources> 96 <testResource> 97 <directory>test</directory> 98 <excludes> 99 <exclude>**/*.java</exclude> 100 </excludes> 101 </testResource> 102 </testResources> 103 <plugins> 104 <plugin> 105 <artifactId>maven-enforcer-plugin</artifactId> 106 <executions> 107 <execution> 108 <id>enforce-versions</id> 109 <goals> 110 <goal>enforce</goal> 111 </goals> 112 <configuration> 113 <rules> 114 <requireMavenVersion> 115 <version>3.0.5</version> 116 </requireMavenVersion> 117 <requireJavaVersion> 118 <version>1.8.0</version> 119 </requireJavaVersion> 120 </rules> 121 </configuration> 122 </execution> 123 </executions> 124 </plugin> 125 </plugins> 126 <pluginManagement> 127 <plugins> 128 <plugin> 129 <artifactId>maven-compiler-plugin</artifactId> 130 <version>3.13.0</version> 131 <configuration> 132 <source>1.8</source> 133 <target>1.8</target> 134 <encoding>UTF-8</encoding> 135 <parameters>true</parameters> 136 <compilerArgs> 137 <!-- 138 Make includes/excludes fully work: 139 https://issues.apache.org/jira/browse/MCOMPILER-174 140 141 (Compare what guava-gwt has to do for maven-javadoc-plugin.) 142 --> 143 <arg>-sourcepath</arg> 144 <arg>doesnotexist</arg> 145 <!-- https://errorprone.info/docs/installation#maven --> 146 <arg>-XDcompilePolicy=simple</arg> 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). --> 161 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> 162 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> 163 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> 164 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> 165 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> 166 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> 167 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> 168 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> 169 <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> 170 <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> 171 </compilerArgs> 172 <annotationProcessorPaths> 173 <path> 174 <groupId>com.google.errorprone</groupId> 175 <artifactId>error_prone_core</artifactId> 176 <version>2.23.0</version> 177 </path> 178 </annotationProcessorPaths> 179 <!-- Fork because we need args like add-exports. (But see the TODO above about .mvn/jvm.config.) --> 180 <fork>true</fork> 181 </configuration> 182 </plugin> 183 <plugin> 184 <groupId>org.mvnsearch</groupId> 185 <artifactId>toolchains-maven-plugin</artifactId> 186 <version>4.5.0</version> 187 <executions> 188 <!-- 189 We can apparently have only one <jdk> per execution: Others are silently ignored :( 190 To properly test this, you need to remove existing toolchains: 191 rm -rf ~/.m2/jdks/ ~/.m2/toolchains.xml 192 (But don't run that if you have put something into ~/.m2/toolchains.xml yourself.) 193 --> 194 <execution> 195 <id>download-11</id> 196 <goals> 197 <goal>toolchain</goal> 198 </goals> 199 <configuration> 200 <toolchains> 201 <jdk> 202 <version>11</version> 203 <vendor>zulu</vendor> 204 </jdk> 205 </toolchains> 206 </configuration> 207 </execution> 208 <execution> 209 <id>download-22-and-surefire-version</id> 210 <goals> 211 <goal>toolchain</goal> 212 </goals> 213 <configuration> 214 <toolchains> 215 <jdk> 216 <version>22</version> 217 <vendor>zulu</vendor> 218 </jdk> 219 <testJdk> 220 <version>${surefire.toolchain.version}</version> 221 <vendor>zulu</vendor> 222 </testJdk> 223 </toolchains> 224 </configuration> 225 </execution> 226 </executions> 227 </plugin> 228 <plugin> 229 <artifactId>maven-toolchains-plugin</artifactId> 230 <version>3.2.0</version> 231 <executions> 232 <execution> 233 <goals> 234 <goal>toolchain</goal> 235 </goals> 236 </execution> 237 </executions> 238 <configuration> 239 <toolchains> 240 <jdk> 241 <version>22</version> 242 <vendor>zulu</vendor> 243 </jdk> 244 </toolchains> 245 </configuration> 246 </plugin> 247 <plugin> 248 <artifactId>maven-jar-plugin</artifactId> 249 <version>3.2.0</version> 250 </plugin> 251 <plugin> 252 <artifactId>maven-source-plugin</artifactId> 253 <version>3.3.1</version> 254 <executions> 255 <execution> 256 <id>attach-sources</id> 257 <goals> 258 <goal>jar-no-fork</goal> 259 </goals> 260 </execution> 261 </executions> 262 <dependencies> 263 <dependency> 264 <groupId>org.codehaus.plexus</groupId> 265 <artifactId>plexus-io</artifactId> 266 <!-- 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). --> 267 <version>3.4.1</version> 268 </dependency> 269 </dependencies> 270 </plugin> 271 <plugin> 272 <groupId>org.codehaus.mojo</groupId> 273 <artifactId>animal-sniffer-maven-plugin</artifactId> 274 <version>1.23</version> 275 <dependencies> 276 <dependency> 277 <groupId>org.ow2.asm</groupId> 278 <artifactId>asm</artifactId> 279 <version>9.6</version> 280 </dependency> 281 </dependencies> 282 <configuration> 283 <annotations>com.google.common.base.IgnoreJRERequirement,com.google.common.cache.IgnoreJRERequirement,com.google.common.collect.IgnoreJRERequirement,com.google.common.hash.IgnoreJRERequirement,com.google.common.io.IgnoreJRERequirement,com.google.common.reflect.IgnoreJRERequirement,com.google.common.testing.IgnoreJRERequirement</annotations> 284 <checkTestClasses>true</checkTestClasses> 285 <signature> 286 <groupId>com.toasttab.android</groupId> 287 <artifactId>gummy-bears-api-21</artifactId> 288 <version>0.8.0</version> 289 <!-- TODO(cpovirk): In principle, it would make sense to *also* test compatibility with JDK 1.8, since guava-android also has JRE users. --> 290 </signature> 291 <ignores> 292 <!-- Unsafe isn't part of the documented Android API, but it is available. 293 And in cases where it's not, we have fallbacks (except maybe Striped64 (b/307807965)?). --> 294 <ignore>sun.misc.Unsafe</ignore> 295 </ignores> 296 </configuration> 297 <executions> 298 <execution> 299 <id>check-java-version-compatibility</id> 300 <phase>test</phase> 301 <goals> 302 <goal>check</goal> 303 </goals> 304 </execution> 305 </executions> 306 </plugin> 307 <plugin> 308 <artifactId>maven-javadoc-plugin</artifactId> 309 <version>3.8.0</version> 310 <configuration> 311 <!-- 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). --> 312 <jdkToolchain> 313 <version>11</version> 314 <vendor>zulu</vendor> 315 </jdkToolchain> 316 <quiet>true</quiet> 317 <notimestamp>true</notimestamp> 318 <encoding>UTF-8</encoding> 319 <docencoding>UTF-8</docencoding> 320 <charset>UTF-8</charset> 321 <additionalOptions> 322 <additionalOption>-XDignore.symbol.file</additionalOption> 323 <additionalOption>-Xdoclint:-html</additionalOption> 324 </additionalOptions> 325 <linksource>true</linksource> 326 <source>8</source> 327 <additionalJOption>${maven-javadoc-plugin.additionalJOptions}</additionalJOption> 328 </configuration> 329 <executions> 330 <execution> 331 <id>attach-docs</id> 332 <goals><goal>jar</goal></goals> 333 </execution> 334 </executions> 335 </plugin> 336 <plugin> 337 <artifactId>maven-dependency-plugin</artifactId> 338 <version>3.1.1</version> 339 </plugin> 340 <plugin> 341 <artifactId>maven-antrun-plugin</artifactId> 342 <version>1.6</version> 343 </plugin> 344 <plugin> 345 <artifactId>maven-surefire-plugin</artifactId> 346 <version>3.3.1</version> 347 <configuration> 348 <jdkToolchain> 349 <version>${surefire.toolchain.version}</version> 350 <vendor>zulu</vendor> 351 </jdkToolchain> 352 <includes> 353 <include>${test.include}</include> 354 </includes> 355 <!-- By having our own entries here, we also override the default exclusion filter, which excludes all nested classes. --> 356 <excludes> 357 <!-- https://github.com/google/guava/issues/2840 --> 358 <exclude>%regex[.*PackageSanityTests.*.class]</exclude> 359 <!-- FeatureUtilTest.*ExampleDerivedInterfaceTester, com.google.common.io.*Tester, incidentally FeatureSpecificTestSuiteBuilderTest.MyAbstractTester (but we don't care either way because it's not meant to run on its own but works OK if it does)... but not NullPointerTesterTest, etc. --> 360 <exclude>%regex[.*Tester.class]</exclude> 361 <!-- Anonymous TestCase subclasses in GeneratedMonitorTest --> 362 <exclude>%regex[.*[$]\d+.class]</exclude> 363 </excludes> 364 <redirectTestOutputToFile>true</redirectTestOutputToFile> 365 <runOrder>alphabetical</runOrder> 366 <!-- Set max heap for tests. --> 367 <!-- Catch dependencies on the default locale by setting it to hi-IN. --> 368 <argLine>-Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.args} ${test.add.opens}</argLine> 369 </configuration> 370 </plugin> 371 <plugin> 372 <artifactId>maven-enforcer-plugin</artifactId> 373 <version>3.0.0-M3</version> 374 </plugin> 375 <plugin> 376 <artifactId>maven-resources-plugin</artifactId> 377 <version>3.3.1</version> 378 </plugin> 379 <plugin> 380 <groupId>org.codehaus.mojo</groupId> 381 <artifactId>build-helper-maven-plugin</artifactId> 382 <version>3.4.0</version> 383 </plugin> 384 </plugins> 385 </pluginManagement> 386 </build> 387 <distributionManagement> 388 <snapshotRepository> 389 <id>sonatype-nexus-snapshots</id> 390 <name>Sonatype Nexus Snapshots</name> 391 <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 392 </snapshotRepository> 393 <repository> 394 <id>sonatype-nexus-staging</id> 395 <name>Nexus Release Repository</name> 396 <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> 397 </repository> 398 <site> 399 <id>guava-site</id> 400 <name>Guava Documentation Site</name> 401 <url>scp://dummy.server/dontinstall/usestaging</url> 402 </site> 403 </distributionManagement> 404 <dependencyManagement> 405 <dependencies> 406 <dependency> 407 <groupId>com.google.code.findbugs</groupId> 408 <artifactId>jsr305</artifactId> 409 <version>${jsr305.version}</version> 410 </dependency> 411 <dependency> 412 <groupId>org.checkerframework</groupId> 413 <artifactId>checker-qual</artifactId> 414 <version>${checker.version}</version> 415 </dependency> 416 <dependency> 417 <groupId>com.google.errorprone</groupId> 418 <artifactId>error_prone_annotations</artifactId> 419 <version>${errorprone.version}</version> 420 </dependency> 421 <dependency> 422 <groupId>com.google.j2objc</groupId> 423 <artifactId>j2objc-annotations</artifactId> 424 <version>${j2objc.version}</version> 425 </dependency> 426 <!-- 427 We moved away from using dependencyManagement for test-only deps because of https://github.com/google/guava/issues/6654. 428 We could probably have resumed it after https://github.com/google/guava/pull/6664. 429 But it's always weird that published poms reference test-only libraries at all, so I'm not in any rush to do so. 430 --> 431 </dependencies> 432 </dependencyManagement> 433 <profiles> 434 <profile> 435 <id>sonatype-oss-release</id> 436 <build> 437 <plugins> 438 <plugin> 439 <artifactId>maven-gpg-plugin</artifactId> 440 <version>3.0.1</version> 441 <executions> 442 <execution> 443 <id>sign-artifacts</id> 444 <phase>verify</phase> 445 <goals> 446 <goal>sign</goal> 447 </goals> 448 </execution> 449 </executions> 450 </plugin> 451 </plugins> 452 </build> 453 </profile> 454 <profile> 455 <!-- 456 Passes JDK 11-12-specific `no-module-directories` flag to Javadoc tool, 457 which is required to make symbol search work correctly in the generated 458 pages. 459 460 This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582). 461 462 Consider removing it once our release and test scripts are migrated to a recent JDK (17+). 463 --> 464 <id>javadocs-jdk11-12</id> 465 <activation> 466 <jdk>[11,13)</jdk> 467 </activation> 468 <properties> 469 <maven-javadoc-plugin.additionalJOptions>--no-module-directories</maven-javadoc-plugin.additionalJOptions> 470 </properties> 471 </profile> 472 <profile> 473 <id>open-jre-modules</id> 474 <activation> 475 <jdk>[9,]</jdk> 476 </activation> 477 <properties> 478 <!-- 479 Some tests need reflective access to the internals of these packages. It is only the 480 tests themselves and not the code being tested that needs that access, though there's no 481 obvious way to ensure that. 482 483 We could consider arranging things so that only the tests we know need this would get 484 the add-opens. Right now that doesn't seem worth the effort, though. 485 --> 486 <test.add.opens> 487 --add-opens java.base/java.lang=ALL-UNNAMED 488 --add-opens java.base/java.util=ALL-UNNAMED 489 --add-opens java.base/sun.security.jca=ALL-UNNAMED 490 </test.add.opens> 491 </properties> 492 </profile> 493 <profile> 494 <id>javac-for-jvm18plus</id> 495 <activation> 496 <!-- 497 In order to build and run the tests against JDK 18+, we need to pass java.security.manager=allow, to make 498 the deprecated 'java.lang.SecurityManager' available for use. 499 --> 500 <jdk>[18,]</jdk> 501 </activation> 502 <properties> 503 <test.add.args>-Djava.security.manager=allow</test.add.args> 504 </properties> 505 </profile> 506 </profiles> 507</project> 508