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