1<?xml version="1.0" encoding="UTF-8"?> 2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4 <modelVersion>4.0.0</modelVersion> 5 <parent> 6 <groupId>com.google.guava</groupId> 7 <artifactId>guava-parent</artifactId> 8 <version>30.0-jre</version> 9 </parent> 10 <artifactId>guava-gwt</artifactId> 11 <name>Guava GWT compatible libs</name> 12 <description> 13 Guava is a suite of core and expanded libraries that include 14 utility classes, google's collections, io classes, and much 15 much more. 16 17 This project includes GWT-friendly sources. 18 </description> 19 <properties> 20 <gwt.version>2.8.2</gwt.version> 21 <gwt.plugin.version>2.8.2</gwt.plugin.version> 22 <gwt.logLevel>WARN</gwt.logLevel> 23 </properties> 24 <repositories> 25 <repository> 26 <id>sonatype-google-snapshots</id> 27 <name>sonatype-google-snapshots</name> 28 <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url> 29 <snapshots> 30 <enabled>true</enabled> 31 </snapshots> 32 </repository> 33 </repositories> 34 <pluginRepositories> 35 <pluginRepository> 36 <id>sonatype-snapshots</id> 37 <name>sonatype-snapshots</name> 38 <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 39 <snapshots> 40 <enabled>true</enabled> 41 </snapshots> 42 </pluginRepository> 43 </pluginRepositories> 44 <dependencies> 45 <dependency> 46 <groupId>com.google.guava</groupId> 47 <artifactId>failureaccess</artifactId> 48 <version>1.0.1</version> 49 </dependency> 50 <dependency> 51 <groupId>com.google.guava</groupId> 52 <artifactId>guava</artifactId> 53 <version>${project.version}</version> 54 </dependency> 55 <dependency> 56 <groupId>com.google.elemental2</groupId> 57 <artifactId>elemental2-promise</artifactId> 58 <version>1.0.0-RC1</version> 59 </dependency> 60 <dependency> 61 <groupId>com.google.guava</groupId> 62 <artifactId>guava-testlib</artifactId> 63 <version>${project.version}</version> 64 <scope>test</scope> 65 </dependency> 66 <dependency> 67 <groupId>com.google.guava</groupId> 68 <artifactId>guava-testlib</artifactId> 69 <version>${project.version}</version> 70 <classifier>tests</classifier> 71 <scope>test</scope> 72 </dependency> 73 <dependency> 74 <groupId>com.google.guava</groupId> 75 <artifactId>guava-tests</artifactId> 76 <version>${project.version}</version> 77 <classifier>tests</classifier> 78 <scope>test</scope> 79 </dependency> 80 <dependency> 81 <groupId>com.google.gwt</groupId> 82 <artifactId>gwt-dev</artifactId> 83 <version>${gwt.version}</version> 84 <scope>provided</scope> 85 </dependency> 86 <dependency> 87 <groupId>com.google.gwt</groupId> 88 <artifactId>gwt-user</artifactId> 89 <version>${gwt.version}</version> 90 <scope>test</scope> 91 </dependency> 92 <dependency> 93 <groupId>com.google.truth</groupId> 94 <artifactId>truth</artifactId> 95 <version>${truth.version}</version> 96 <classifier>gwt</classifier> 97 <scope>test</scope> 98 </dependency> 99 <dependency> 100 <groupId>com.google.truth.extensions</groupId> 101 <artifactId>truth-java8-extension</artifactId> 102 <version>${truth.version}</version> 103 <classifier>gwt</classifier> 104 <scope>test</scope> 105 </dependency> 106 <dependency> 107 <groupId>org.checkerframework</groupId> 108 <artifactId>checker-qual</artifactId> 109 </dependency> 110 </dependencies> 111 <build> 112 <plugins> 113 <plugin> 114 <artifactId>maven-compiler-plugin</artifactId> 115 <configuration> 116 <excludes> 117 <!-- Yes, we want to exclude ForceGuavaCompilation 4 times: --> 118 <!-- (And we might as well exclude DummyJavadocClass 3 times (though it would be harmless to include).) --> 119 <!-- 1. Don't compile it (since that requires a *non-test* dep on gwt-user. --> 120 <exclude>**/ForceGuavaCompilation*</exclude> 121 <exclude>**/DummyJavadocClass*</exclude> 122 </excludes> 123 </configuration> 124 </plugin> 125 <plugin> 126 <artifactId>maven-jar-plugin</artifactId> 127 <configuration> 128 <excludes> 129 <!-- 2. Don't include the source in the jar (since that would let users depend on it from GWT client code, which is compiled from source). --> 130 <exclude>**/ForceGuavaCompilation*</exclude> 131 <exclude>**/DummyJavadocClass*</exclude> 132 </excludes> 133 </configuration> 134 </plugin> 135 <plugin> 136 <artifactId>maven-source-plugin</artifactId> 137 <configuration> 138 <excludes> 139 <!-- 3. Don't include it in the source jar (since it's really more of a "test" than it is production code). --> 140 <exclude>**/ForceGuavaCompilation*</exclude> 141 <exclude>**/DummyJavadocClass*</exclude> 142 </excludes> 143 </configuration> 144 </plugin> 145 <plugin> 146 <artifactId>maven-javadoc-plugin</artifactId> 147 <configuration> 148 <sourceFileExcludes> 149 <!-- 4. Don't build Javadoc for it (since that, too, would require a *non-test* dep on gwt-user. --> 150 <sourceFileExclude>**/ForceGuavaCompilation*</sourceFileExclude> 151 </sourceFileExcludes> 152 <!-- The above exclusion doesn't actually matter unless I prevent Javadoc from autodiscovering the source in the sourcepath, which defaults to the source directory :\ Boo for -sourcepath. --> 153 <sourcepath>doesnotexist</sourcepath> 154 <!-- Note that we do need to build Javadoc for *some* class. Otherwise, we get an empty Javadoc jar, which the Sonatype repository manager rejects. To avoid that, we've introduced a dummy class. But we made it package-private so that no one can depend on it. That in turn forced us to configure Javadoc to show package-private APIs. --> 155 <show>package</show> 156 </configuration> 157 </plugin> 158 <!-- Disable "normal" testing, which doesn't work for GWT tests. --> 159 <plugin> 160 <artifactId>maven-surefire-plugin</artifactId> 161 <configuration> 162 <skip>true</skip> 163 </configuration> 164 </plugin> 165 <plugin> 166 <artifactId>maven-dependency-plugin</artifactId> 167 <executions> 168 <execution> 169 <id>unpack-failureaccess-sources</id> 170 <phase>generate-resources</phase> 171 <goals><goal>unpack-dependencies</goal></goals> 172 <configuration> 173 <includeArtifactIds>failureaccess</includeArtifactIds> 174 <classifier>sources</classifier> 175 <excludeTransitive>true</excludeTransitive> 176 <excludes>META-INF/MANIFEST.MF</excludes> 177 <outputDirectory>${project.build.directory}/failureaccess-sources</outputDirectory> 178 <type>java-source</type> 179 <silent>false</silent> 180 </configuration> 181 </execution> 182 <execution> 183 <id>unpack-guava-sources</id> 184 <phase>generate-resources</phase> 185 <goals><goal>unpack-dependencies</goal></goals> 186 <configuration> 187 <includeArtifactIds>guava</includeArtifactIds> 188 <classifier>sources</classifier> 189 <excludeTransitive>true</excludeTransitive> 190 <excludes>META-INF/MANIFEST.MF</excludes> 191 <outputDirectory>${project.build.directory}/guava-sources</outputDirectory> 192 <type>java-source</type> 193 <silent>false</silent> 194 </configuration> 195 </execution> 196 <execution> 197 <id>unpack-guava-testlib-sources</id> 198 <phase>generate-resources</phase> 199 <goals><goal>unpack-dependencies</goal></goals> 200 <configuration> 201 <includeArtifactIds>guava-testlib</includeArtifactIds> 202 <classifier>sources</classifier> 203 <excludeTransitive>true</excludeTransitive> 204 <excludes>META-INF/MANIFEST.MF</excludes> 205 <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory> 206 <type>java-source</type> 207 <silent>false</silent> 208 </configuration> 209 </execution> 210 <execution> 211 <id>unpack-guava-testlib-test-sources</id> 212 <phase>generate-resources</phase> 213 <goals><goal>unpack-dependencies</goal></goals> 214 <configuration> 215 <includeArtifactIds>guava-testlib</includeArtifactIds> 216 <classifier>test-sources</classifier> 217 <excludeTransitive>true</excludeTransitive> 218 <excludes>META-INF/MANIFEST.MF</excludes> 219 <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory> 220 <type>java-source</type> 221 <silent>false</silent> 222 </configuration> 223 </execution> 224 <execution> 225 <id>unpack-guava-test-sources</id> 226 <phase>generate-resources</phase> 227 <goals><goal>unpack-dependencies</goal></goals> 228 <configuration> 229 <includeArtifactIds>guava-tests</includeArtifactIds> 230 <classifier>test-sources</classifier> 231 <excludeTransitive>true</excludeTransitive> 232 <excludes>META-INF/MANIFEST.MF</excludes> 233 <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory> 234 <type>java-source</type> 235 <silent>false</silent> 236 </configuration> 237 </execution> 238 </executions> 239 <dependencies> 240 <dependency> 241 <groupId>com.google.guava</groupId> 242 <artifactId>failureaccess</artifactId> 243 <version>1.0.1</version> 244 <classifier>sources</classifier> 245 </dependency> 246 <dependency> 247 <groupId>com.google.guava</groupId> 248 <artifactId>guava</artifactId> 249 <version>${project.version}</version> 250 <classifier>sources</classifier> 251 </dependency> 252 <dependency> 253 <groupId>com.google.guava</groupId> 254 <artifactId>guava-testlib</artifactId> 255 <version>${project.version}</version> 256 <classifier>sources</classifier> 257 </dependency> 258 <dependency> 259 <groupId>com.google.guava</groupId> 260 <artifactId>guava-testlib</artifactId> 261 <version>${project.version}</version> 262 <classifier>test-sources</classifier> 263 </dependency> 264 <dependency> 265 <groupId>com.google.guava</groupId> 266 <artifactId>guava-tests</artifactId> 267 <version>${project.version}</version> 268 <classifier>test-sources</classifier> 269 </dependency> 270 </dependencies> 271 </plugin> 272 <plugin> 273 <artifactId>maven-antrun-plugin</artifactId> 274 <executions> 275 <execution> 276 <id>copy-gwt-files</id> 277 <phase>generate-resources</phase> 278 <goals><goal>run</goal></goals> 279 <configuration> 280 <target name="copy-gwt-resources"> 281 <copy toDir="${project.build.directory}/guava-gwt-sources"> 282 <fileset dir="${project.build.directory}/guava-sources"> 283 <contains text="@GwtCompatible"/> 284 </fileset> 285 </copy> 286 <!-- The following don't contain @GwtCompatible for dependency reasons. --> 287 <copy toDir="${project.build.directory}/guava-gwt-sources"> 288 <fileset dir="${project.build.directory}/guava-sources"> 289 <include name="**/ListenableFuture.java" /> 290 </fileset> 291 </copy> 292 <copy toDir="${project.build.directory}/guava-gwt-sources"> 293 <fileset dir="${project.build.directory}/failureaccess-sources"> 294 <include name="**/InternalFutures.java" /> 295 </fileset> 296 </copy> 297 <copy toDir="${project.build.directory}/guava-gwt-sources"> 298 <fileset dir="${project.build.directory}/failureaccess-sources"> 299 <include name="**/InternalFutureFailureAccess.java" /> 300 </fileset> 301 </copy> 302 <copy toDir="${project.build.directory}/guava-test-gwt-sources"> 303 <fileset dir="${project.build.directory}/guava-test-sources"> 304 <contains text="@GwtCompatible"/> 305 </fileset> 306 </copy> 307 </target> 308 </configuration> 309 </execution> 310 </executions> 311 </plugin> 312 <plugin> 313 <groupId>org.codehaus.mojo</groupId> 314 <artifactId>gwt-maven-plugin</artifactId> 315 <version>${gwt.plugin.version}</version> 316 <executions> 317 <execution> 318 <id>gwt-compile</id> 319 <goals> 320 <goal>compile</goal> 321 </goals> 322 <configuration> 323 <module>com.google.common.ForceGuavaCompilation</module> 324 <failOnError>true</failOnError> 325 <logLevel>${gwt.logLevel}</logLevel> 326 <validateOnly>true</validateOnly> 327 <sourceLevel>1.8</sourceLevel> 328 <!-- 329 To avoid "java.io.IOException: User limit of inotify watches reached" under JDK10. 330 Presumably we don't need inotify, since we don't intend to change files during the 331 build? 332 --> 333 <extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs> 334 </configuration> 335 </execution> 336 <!-- 337 GWT issues some scary warnings while running tests, but I believe they are harmless. 338 Let's take the warnings for one module, c.g.c.base.testModule, as an example: 339 340 [INFO] Validating units: 341 [INFO] Ignored 53 units with compilation errors in first pass. 342 [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. 343 344 Turning up the log level, we see that GWT is trying to compile classes from other 345 packages, like RangeTest. The reason for this is that GWT doesn't distinguish between 346 .java files in c.g.c.collect.Collect, a module that the c.g.c.base test module inherits, 347 and .java files in c.g.c.collect.testModule, one that it doesn't[*]. Consequently, 348 c.g.c.base.testModule transitively pulls in .java files from both modules while reading 349 the module description of only the prod module. And the prod module doesn't inherit all 350 the modules that the test module classes use, so we get errors. 351 352 The good news is that, despite ignoring errors here, GWT does fail if any errors affect 353 classes that are actually used in the module under test. 354 355 One way to eliminate the warnings is to make base.testModule include the not really 356 necessary <inherits> lines for c.g.c.collect.testModule, etc. However, adding <inherits> 357 lines could make c.g.c.base.testModule transitively inherit from extra modules. If some 358 of those modules are ones that it uses but forgets to list in its own <inherits>, we'd 359 like to get an error. Currently we do, but if we add the extra <inherits> lines, we 360 won't. 361 362 I have one idea for a better approach, but it's painful, and I haven't tested it: We 363 could postprocess Collect.gwt.xml to add <skip> lines for all the files that should be 364 covered by testModule.gwt.xml. Maybe I'll try it someday. 365 366 [*] https://code.google.com/p/google-web-toolkit/wiki/ResourceOracle#When_multiple_PathPrefix_es_have_the_same_path 367 https://code.google.com/p/google-web-toolkit/issues/detail?id=7581 368 --> 369 <execution> 370 <id>gwt-test</id> 371 <goals> 372 <goal>test</goal> 373 </goals> 374 <configuration> 375 <module>com.google.common.GuavaTests</module> 376 <includes>**/GwtTestSuite.java</includes> 377 <logLevel>${gwt.logLevel}</logLevel> 378 <mode>htmlunit</mode> 379 <htmlunit>FF38</htmlunit> 380 <productionMode>true</productionMode> 381 <!-- Fix OutOfMemoryError under Travis. --> 382 <extraJvmArgs>-Xms3500m -Xmx3500m -Xss1024k</extraJvmArgs> 383 <sourceLevel>1.8</sourceLevel> 384 <!-- Keep these timeouts very large because, if we hit the timeout, the tests silently pass :( --> 385 <testTimeOut>86400 <!-- seconds --></testTimeOut> 386 <testMethodTimeout>1440 <!-- minutes --></testMethodTimeout> 387 <!-- Presumably we want watchFileChanges=false here, since we want it for compile: --> 388 <extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs> 389 </configuration> 390 </execution> 391 </executions> 392 </plugin> 393 </plugins> 394 <resources> 395 <resource> 396 <directory>src</directory> 397 </resource> 398 <resource> 399 <directory>src-super</directory> 400 </resource> 401 <resource> 402 <directory>${project.build.directory}/guava-gwt-sources</directory> 403 </resource> 404 </resources> 405 <testResources> 406 <testResource> 407 <directory>test</directory> 408 </testResource> 409 <testResource> 410 <directory>test-super</directory> 411 </testResource> 412 <testResource> 413 <directory>${project.build.directory}/guava-test-gwt-sources</directory> 414 </testResource> 415 </testResources> 416 </build> 417</project> 418