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