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-jre</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 <!-- Override this with -Dtest.include="**/SomeTest.java" on the CLI --> 16 <test.include>%regex[.*.class]</test.include> 17 <truth.version>1.1.3</truth.version> 18 <jsr305.version>3.0.2</jsr305.version> 19 <checker.version>3.41.0</checker.version> 20 <errorprone.version>2.23.0</errorprone.version> 21 <j2objc.version>2.8</j2objc.version> 22 <javac.version>9+181-r4173-1</javac.version> 23 <!-- Empty for all JDKs but 9-12 --> 24 <maven-javadoc-plugin.additionalJOptions></maven-javadoc-plugin.additionalJOptions> 25 <project.build.outputTimestamp>2023-02-01T00:00:00Z</project.build.outputTimestamp> 26 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 27 <test.add.opens></test.add.opens> 28 <module.status>release</module.status> 29 <variant.jvmEnvironment>standard-jvm</variant.jvmEnvironment> 30 <variant.jvmEnvironmentVariantName>jre</variant.jvmEnvironmentVariantName> 31 <otherVariant.version>32.1.2-android</otherVariant.version> 32 <otherVariant.jvmEnvironment>android</otherVariant.jvmEnvironment> 33 <otherVariant.jvmEnvironmentVariantName>android</otherVariant.jvmEnvironmentVariantName> 34 </properties> 35 <issueManagement> 36 <system>GitHub Issues</system> 37 <url>https://github.com/google/guava/issues</url> 38 </issueManagement> 39 <inceptionYear>2010</inceptionYear> 40 <licenses> 41 <license> 42 <name>Apache License, Version 2.0</name> 43 <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> 44 <distribution>repo</distribution> 45 </license> 46 </licenses> 47 <scm> 48 <connection>scm:git:https://github.com/google/guava.git</connection> 49 <developerConnection>scm:git:git@github.com:google/guava.git</developerConnection> 50 <url>https://github.com/google/guava</url> 51 </scm> 52 <developers> 53 <developer> 54 <id>kevinb9n</id> 55 <name>Kevin Bourrillion</name> 56 <email>kevinb@google.com</email> 57 <organization>Google</organization> 58 <organizationUrl>http://www.google.com</organizationUrl> 59 <roles> 60 <role>owner</role> 61 <role>developer</role> 62 </roles> 63 <timezone>-8</timezone> 64 </developer> 65 </developers> 66 <ciManagement> 67 <system>GitHub Actions</system> 68 <url>https://github.com/google/guava/actions</url> 69 </ciManagement> 70 <modules> 71 <module>guava</module> 72 <module>guava-bom</module> 73 <module>guava-gwt</module> 74 <module>guava-testlib</module> 75 <module>guava-tests</module> 76 </modules> 77 <build> 78 <!-- Handle where Guava deviates from Maven defaults --> 79 <sourceDirectory>src</sourceDirectory> 80 <testSourceDirectory>test</testSourceDirectory> 81 <resources> 82 <resource> 83 <directory>..</directory> 84 <includes> 85 <include>LICENSE</include> 86 </includes> 87 <targetPath>META-INF</targetPath> 88 </resource> 89 </resources> 90 <testResources> 91 <testResource> 92 <directory>test</directory> 93 <excludes> 94 <exclude>**/*.java</exclude> 95 </excludes> 96 </testResource> 97 </testResources> 98 <plugins> 99 <plugin> 100 <artifactId>maven-enforcer-plugin</artifactId> 101 <executions> 102 <execution> 103 <id>enforce-versions</id> 104 <goals> 105 <goal>enforce</goal> 106 </goals> 107 <configuration> 108 <rules> 109 <requireMavenVersion> 110 <version>3.0.5</version> 111 </requireMavenVersion> 112 <requireJavaVersion> 113 <version>1.8.0</version> 114 </requireJavaVersion> 115 </rules> 116 </configuration> 117 </execution> 118 </executions> 119 </plugin> 120 </plugins> 121 <pluginManagement> 122 <plugins> 123 <plugin> 124 <artifactId>maven-compiler-plugin</artifactId> 125 <version>3.8.1</version> 126 <configuration> 127 <source>1.8</source> 128 <target>1.8</target> 129 <encoding>UTF-8</encoding> 130 <parameters>true</parameters> 131 <compilerArgs> 132 <!-- 133 Make includes/excludes fully work: 134 https://issues.apache.org/jira/browse/MCOMPILER-174 135 136 (Compare what guava-gwt has to do for maven-javadoc-plugin.) 137 --> 138 <arg>-sourcepath</arg> 139 <arg>doesnotexist</arg> 140 <!-- https://errorprone.info/docs/installation#maven --> 141 <arg>-XDcompilePolicy=simple</arg> 142 <!-- -Xplugin:ErrorProne is set conditionally by a profile. --> 143 </compilerArgs> 144 <annotationProcessorPaths> 145 <path> 146 <groupId>com.google.errorprone</groupId> 147 <artifactId>error_prone_core</artifactId> 148 <version>2.23.0</version> 149 </path> 150 </annotationProcessorPaths> 151 <!-- Fork: 152 153 - for JDK8 because we use a javac9 bootclasspath 154 155 - for JDK9+ because we need args like add-exports 156 --> 157 <fork>true</fork> 158 </configuration> 159 </plugin> 160 <plugin> 161 <artifactId>maven-jar-plugin</artifactId> 162 <version>3.2.0</version> 163 </plugin> 164 <plugin> 165 <artifactId>maven-source-plugin</artifactId> 166 <version>3.3.0</version> 167 <executions> 168 <execution> 169 <id>attach-sources</id> 170 <goals> 171 <goal>jar-no-fork</goal> 172 </goals> 173 </execution> 174 </executions> 175 </plugin> 176 <plugin> 177 <groupId>org.codehaus.mojo</groupId> 178 <artifactId>animal-sniffer-maven-plugin</artifactId> 179 <version>1.23</version> 180 <configuration> 181 <annotations>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> 182 <checkTestClasses>true</checkTestClasses> 183 <signature> 184 <groupId>org.codehaus.mojo.signature</groupId> 185 <artifactId>java18</artifactId> 186 <version>1.0</version> 187 </signature> 188 </configuration> 189 <executions> 190 <execution> 191 <id>check-java-version-compatibility</id> 192 <phase>test</phase> 193 <goals> 194 <goal>check</goal> 195 </goals> 196 </execution> 197 </executions> 198 </plugin> 199 <plugin> 200 <artifactId>maven-javadoc-plugin</artifactId> 201 <version>3.5.0</version> 202 <configuration> 203 <quiet>true</quiet> 204 <notimestamp>true</notimestamp> 205 <encoding>UTF-8</encoding> 206 <docencoding>UTF-8</docencoding> 207 <charset>UTF-8</charset> 208 <additionalOptions> 209 <additionalOption>-XDignore.symbol.file</additionalOption> 210 <additionalOption>-Xdoclint:-html</additionalOption> 211 </additionalOptions> 212 <linksource>true</linksource> 213 <source>${java.specification.version}</source> 214 <additionalJOption>${maven-javadoc-plugin.additionalJOptions}</additionalJOption> 215 </configuration> 216 <executions> 217 <execution> 218 <id>attach-docs</id> 219 <goals><goal>jar</goal></goals> 220 </execution> 221 </executions> 222 </plugin> 223 <plugin> 224 <artifactId>maven-dependency-plugin</artifactId> 225 <version>3.1.1</version> 226 </plugin> 227 <plugin> 228 <artifactId>maven-antrun-plugin</artifactId> 229 <version>1.6</version> 230 </plugin> 231 <plugin> 232 <artifactId>maven-surefire-plugin</artifactId> 233 <version>2.7.2</version> 234 <configuration> 235 <includes> 236 <include>${test.include}</include> 237 </includes> 238 <!-- By having our own entries here, we also override the default exclusion filter, which excludes all nested classes. --> 239 <excludes> 240 <!-- https://github.com/google/guava/issues/2840 --> 241 <exclude>%regex[.*PackageSanityTests.*.class]</exclude> 242 <!-- 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. --> 243 <exclude>%regex[.*Tester.class]</exclude> 244 <!-- Anonymous TestCase subclasses in GeneratedMonitorTest --> 245 <exclude>%regex[.*[$]\d+.class]</exclude> 246 </excludes> 247 <redirectTestOutputToFile>true</redirectTestOutputToFile> 248 <runOrder>alphabetical</runOrder> 249 <!-- Set max heap for tests. --> 250 <!-- Catch dependencies on the default locale by setting it to hi-IN. --> 251 <argLine>-Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.opens}</argLine> 252 </configuration> 253 </plugin> 254 <plugin> 255 <artifactId>maven-enforcer-plugin</artifactId> 256 <version>3.0.0-M3</version> 257 </plugin> 258 <plugin> 259 <artifactId>maven-resources-plugin</artifactId> 260 <version>3.3.1</version> 261 </plugin> 262 <plugin> 263 <groupId>org.codehaus.mojo</groupId> 264 <artifactId>build-helper-maven-plugin</artifactId> 265 <version>3.4.0</version> 266 </plugin> 267 </plugins> 268 </pluginManagement> 269 </build> 270 <distributionManagement> 271 <snapshotRepository> 272 <id>sonatype-nexus-snapshots</id> 273 <name>Sonatype Nexus Snapshots</name> 274 <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 275 </snapshotRepository> 276 <repository> 277 <id>sonatype-nexus-staging</id> 278 <name>Nexus Release Repository</name> 279 <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> 280 </repository> 281 <site> 282 <id>guava-site</id> 283 <name>Guava Documentation Site</name> 284 <url>scp://dummy.server/dontinstall/usestaging</url> 285 </site> 286 </distributionManagement> 287 <dependencyManagement> 288 <dependencies> 289 <dependency> 290 <groupId>com.google.code.findbugs</groupId> 291 <artifactId>jsr305</artifactId> 292 <version>${jsr305.version}</version> 293 </dependency> 294 <dependency> 295 <groupId>org.checkerframework</groupId> 296 <artifactId>checker-qual</artifactId> 297 <version>${checker.version}</version> 298 </dependency> 299 <dependency> 300 <groupId>com.google.errorprone</groupId> 301 <artifactId>error_prone_annotations</artifactId> 302 <version>${errorprone.version}</version> 303 </dependency> 304 <dependency> 305 <groupId>com.google.j2objc</groupId> 306 <artifactId>j2objc-annotations</artifactId> 307 <version>${j2objc.version}</version> 308 </dependency> 309 <!-- 310 We moved away from using dependencyManagement for test-only deps because of https://github.com/google/guava/issues/6654. 311 We could probably have resumed it after https://github.com/google/guava/pull/6664. 312 But it's always weird that published poms reference test-only libraries at all, so I'm not in any rush to do so. 313 --> 314 </dependencies> 315 </dependencyManagement> 316 <profiles> 317 <profile> 318 <id>sonatype-oss-release</id> 319 <build> 320 <plugins> 321 <plugin> 322 <artifactId>maven-gpg-plugin</artifactId> 323 <version>3.0.1</version> 324 <executions> 325 <execution> 326 <id>sign-artifacts</id> 327 <phase>verify</phase> 328 <goals> 329 <goal>sign</goal> 330 </goals> 331 </execution> 332 </executions> 333 </plugin> 334 </plugins> 335 </build> 336 </profile> 337 <profile> 338 <!-- 339 Passes JDK 11-12-specific `no-module-directories` flag to Javadoc tool, 340 which is required to make symbol search work correctly in the generated 341 pages. 342 343 This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582). 344 345 Consider removing it once our release and test scripts are migrated to a recent JDK (17+). 346 --> 347 <id>javadocs-jdk11-12</id> 348 <activation> 349 <jdk>[11,13)</jdk> 350 </activation> 351 <properties> 352 <maven-javadoc-plugin.additionalJOptions>--no-module-directories</maven-javadoc-plugin.additionalJOptions> 353 </properties> 354 </profile> 355 <profile> 356 <id>open-jre-modules</id> 357 <activation> 358 <jdk>[9,]</jdk> 359 </activation> 360 <properties> 361 <!-- 362 Some tests need reflective access to the internals of these packages. It is only the 363 tests themselves and not the code being tested that needs that access, though there's no 364 obvious way to ensure that. 365 366 We could consider arranging things so that only the tests we know need this would get 367 the add-opens. Right now that doesn't seem worth the effort, though. 368 --> 369 <test.add.opens> 370 --add-opens java.base/java.lang=ALL-UNNAMED 371 --add-opens java.base/java.util=ALL-UNNAMED 372 --add-opens java.base/sun.security.jca=ALL-UNNAMED 373 </test.add.opens> 374 </properties> 375 </profile> 376 <profile> 377 <id>javac9-for-jdk8</id> 378 <activation> 379 <jdk>1.8</jdk> 380 </activation> 381 <build> 382 <plugins> 383 <plugin> 384 <artifactId>maven-compiler-plugin</artifactId> 385 <configuration> 386 <!-- Under JDK8, we continue to use errorprone's javac9 (even 387 though we don't run Error Prone itself, which no longer 388 supports JDK8!). 389 390 Why? At some point, presumably after 391 https://github.com/google/guava/commit/e06a8cec65815599e510d7f9c1ea9d2a8eaa438a, 392 builds with JDK8 began failing animal-sniffer with the error: 393 394 Failed to check signatures: Bad class file .../CollectionFuture$ListFuture.class 395 396 One way of dealing with that would be to disable 397 animal-sniffer. And that would be fine for our -jre builds: 398 If we're building with JDK8, then clearly we're sticking to 399 JDK8 APIs. However, I assume (but did not confirm) that we'd 400 have the same issue with our -android builds, which need 401 animal-sniffer so that they can check that we're sticking to 402 JDK6-like APIs. 403 404 So instead, we use javac9, which doesn't lead to this error. 405 --> 406 <compilerArgs combine.children="append"> 407 <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg> 408 </compilerArgs> 409 </configuration> 410 </plugin> 411 </plugins> 412 </build> 413 </profile> 414 <profile> 415 <id>run-error-prone</id> 416 <activation> 417 <!-- 418 Error Prone requires 11+: https://errorprone.info/docs/installation 419 We skip 12-15 because of https://github.com/google/error-prone/issues/3540. 420 --> 421 <jdk>[11,12),[16,)</jdk> 422 </activation> 423 <build> 424 <plugins> 425 <plugin> 426 <artifactId>maven-compiler-plugin</artifactId> 427 <configuration> 428 <compilerArgs combine.children="append"> 429 <!-- https://errorprone.info/docs/installation#maven --> 430 <!-- TODO(cpovirk): Enable NullArgumentForNonNullParameter for 431 prod code. It's disabled automatically for "test code" 432 (which is good: our tests have intentional violations), but 433 Error Prone doesn't know it's building test code unless we 434 pass -XepCompilingTestOnlyCode, and that argument needs to 435 be passed as part of the same <arg> as -Xplugin:ErrorProne, 436 and I gave up trying to figure out how to do that for test 437 compilation only. --> 438 <arg>-Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF -Xep:Java8ApiChecker:ERROR</arg> 439 <!-- https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md#jdk-16 --> 440 <!-- TODO(cpovirk): Use .mvn/jvm.config instead (per 441 https://errorprone.info/docs/installation#maven) if it can 442 be made not to interfere with JDK8 or if we stop building 443 with JDK8. --> 444 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> 445 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> 446 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> 447 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> 448 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> 449 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> 450 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> 451 <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> 452 <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> 453 <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> 454 </compilerArgs> 455 </configuration> 456 </plugin> 457 </plugins> 458 </build> 459 </profile> 460 </profiles> 461</project> 462