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