blob: b96ed97bfe199bf9e7df1eef8574aad45194f88c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.google.guava</groupId>
<artifactId>guava-parent</artifactId>
<version>27.1-jre</version>
</parent>
<artifactId>guava-gwt</artifactId>
<name>Guava GWT compatible libs</name>
<description>
Guava is a suite of core and expanded libraries that include
utility classes, google's collections, io classes, and much
much more.
This project includes GWT-friendly sources.
</description>
<properties>
<!-- We skip GWT tests by default. To run, pass -Dgwt.test.include=**/GwtTestSuite.java -->
<gwt.test.include>**/DoesNotMatchAnyTests.java</gwt.test.include>
<gwt.version>2.8.2</gwt.version>
<gwt.plugin.version>2.8.2</gwt.plugin.version>
<gwt.logLevel>WARN</gwt.logLevel>
</properties>
<repositories>
<repository>
<id>sonatype-google-snapshots</id>
<name>sonatype-google-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-snapshots</id>
<name>sonatype-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>failureaccess</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>${truth.version}</version>
<classifier>gwt</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth.extensions</groupId>
<artifactId>truth-java8-extension</artifactId>
<version>${truth.version}</version>
<classifier>gwt</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<!-- Disable "normal" testing, which doesn't work for GWT tests. -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-failureaccess-sources</id>
<phase>generate-resources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>failureaccess</includeArtifactIds>
<classifier>sources</classifier>
<excludeTransitive>true</excludeTransitive>
<excludes>META-INF/MANIFEST.MF</excludes>
<outputDirectory>${project.build.directory}/failureaccess-sources</outputDirectory>
<type>java-source</type>
<silent>false</silent>
</configuration>
</execution>
<execution>
<id>unpack-guava-sources</id>
<phase>generate-resources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>guava</includeArtifactIds>
<classifier>sources</classifier>
<excludeTransitive>true</excludeTransitive>
<excludes>META-INF/MANIFEST.MF</excludes>
<outputDirectory>${project.build.directory}/guava-sources</outputDirectory>
<type>java-source</type>
<silent>false</silent>
</configuration>
</execution>
<execution>
<id>unpack-guava-testlib-sources</id>
<phase>generate-resources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>guava-testlib</includeArtifactIds>
<classifier>sources</classifier>
<excludeTransitive>true</excludeTransitive>
<excludes>META-INF/MANIFEST.MF</excludes>
<outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
<type>java-source</type>
<silent>false</silent>
</configuration>
</execution>
<execution>
<id>unpack-guava-testlib-test-sources</id>
<phase>generate-resources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>guava-testlib</includeArtifactIds>
<classifier>test-sources</classifier>
<excludeTransitive>true</excludeTransitive>
<excludes>META-INF/MANIFEST.MF</excludes>
<outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
<type>java-source</type>
<silent>false</silent>
</configuration>
</execution>
<execution>
<id>unpack-guava-test-sources</id>
<phase>generate-resources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>guava-tests</includeArtifactIds>
<classifier>test-sources</classifier>
<excludeTransitive>true</excludeTransitive>
<excludes>META-INF/MANIFEST.MF</excludes>
<outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
<type>java-source</type>
<silent>false</silent>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>failureaccess</artifactId>
<version>1.0.1</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>${project.version}</version>
<classifier>test-sources</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-tests</artifactId>
<version>${project.version}</version>
<classifier>test-sources</classifier>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-gwt-files</id>
<phase>generate-resources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target name="copy-gwt-resources">
<copy toDir="${project.build.directory}/guava-gwt-sources">
<fileset dir="${project.build.directory}/guava-sources">
<contains text="@GwtCompatible"/>
</fileset>
</copy>
<!-- The following don't contain @GwtCompatible for dependency reasons. -->
<copy toDir="${project.build.directory}/guava-gwt-sources">
<fileset dir="${project.build.directory}/guava-sources">
<include name="**/ListenableFuture.java" />
</fileset>
</copy>
<copy toDir="${project.build.directory}/guava-gwt-sources">
<fileset dir="${project.build.directory}/failureaccess-sources">
<include name="**/InternalFutures.java" />
</fileset>
</copy>
<copy toDir="${project.build.directory}/guava-gwt-sources">
<fileset dir="${project.build.directory}/failureaccess-sources">
<include name="**/InternalFutureFailureAccess.java" />
</fileset>
</copy>
<copy toDir="${project.build.directory}/guava-test-gwt-sources">
<fileset dir="${project.build.directory}/guava-test-sources">
<contains text="@GwtCompatible"/>
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.plugin.version}</version>
<executions>
<execution>
<id>gwt-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<module>com.google.common.ForceGuavaCompilation</module>
<failOnError>true</failOnError>
<logLevel>${gwt.logLevel}</logLevel>
<validateOnly>true</validateOnly>
<sourceLevel>1.8</sourceLevel>
<!--
To avoid "java.io.IOException: User limit of inotify watches reached" under JDK10.
Presumably we don't need inotify, since we don't intend to change files during the
build?
-->
<extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs>
</configuration>
</execution>
<!--
GWT issues some scary warnings while running tests, but I believe they are harmless.
Let's take the warnings for one module, c.g.c.base.testModule, as an example:
[INFO] Validating units:
[INFO] Ignored 53 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Turning up the log level, we see that GWT is trying to compile classes from other
packages, like RangeTest. The reason for this is that GWT doesn't distinguish between
.java files in c.g.c.collect.Collect, a module that the c.g.c.base test module inherits,
and .java files in c.g.c.collect.testModule, one that it doesn't[*]. Consequently,
c.g.c.base.testModule transitively pulls in .java files from both modules while reading
the module description of only the prod module. And the prod module doesn't inherit all
the modules that the test module classes use, so we get errors.
The good news is that, despite ignoring errors here, GWT does fail if any errors affect
classes that are actually used in the module under test.
One way to eliminate the warnings is to make base.testModule include the not really
necessary <inherits> lines for c.g.c.collect.testModule, etc. However, adding <inherits>
lines could make c.g.c.base.testModule transitively inherit from extra modules. If some
of those modules are ones that it uses but forgets to list in its own <inherits>, we'd
like to get an error. Currently we do, but if we add the extra <inherits> lines, we
won't.
I have one idea for a better approach, but it's painful, and I haven't tested it: We
could postprocess Collect.gwt.xml to add <skip> lines for all the files that should be
covered by testModule.gwt.xml. Maybe I'll try it someday.
[*] https://code.google.com/p/google-web-toolkit/wiki/ResourceOracle#When_multiple_PathPrefix_es_have_the_same_path
https://code.google.com/p/google-web-toolkit/issues/detail?id=7581
-->
<execution>
<id>gwt-test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<module>com.google.common.GuavaTests</module>
<includes>${gwt.test.include}</includes>
<logLevel>${gwt.logLevel}</logLevel>
<mode>htmlunit</mode>
<htmlunit>FF38</htmlunit>
<productionMode>true</productionMode>
<!-- Fix OutOfMemoryError under Travis. -->
<extraJvmArgs>-Xms3500m -Xmx3500m -Xss1024k</extraJvmArgs>
<sourceLevel>1.8</sourceLevel>
<!-- Keep these timeouts very large because, if we hit the timeout, the tests silently pass :( -->
<testTimeOut>86400 <!-- seconds --></testTimeOut>
<testMethodTimeout>1440 <!-- minutes --></testMethodTimeout>
<!-- Presumably we want watchFileChanges=false here, since we want it for compile: -->
<extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src</directory>
</resource>
<resource>
<directory>src-super</directory>
</resource>
<resource>
<directory>${project.build.directory}/guava-gwt-sources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>test</directory>
</testResource>
<testResource>
<directory>test-super</directory>
</testResource>
<testResource>
<directory>${project.build.directory}/guava-test-gwt-sources</directory>
</testResource>
</testResources>
</build>
</project>