Hi,
I'm starting a new, experimental GWT project that will use Firebase on the server side, so it doesn't have the typical 'shared' and 'server' code that many GWT projects do. I've used gwt-maven-plugin/gwt-maven-plugin in the past, but want to make a clean break and use the tbroyer/gwt-maven-plugin, as this looks cleaner with its multi-module approach.
I'd like to use Polymer and Firebase on the client side through JsInterop, so I'll be using GWT 2.8.0-SNAPSHOT and, hopefully, JDK 1.8 so I can use lambdas.
I started by using "modular-webapp" from the gwt-maven-archetypes, and stripping out the shared and server modules then adding my own web module. It's getting there, but as I'm starting my project I'm running into some questions:
- I'm planning on having three modules: A) one with GWT client code, B) one that contains the static host page and any other static content and C) one that contains some nodejs worker code that accesses Firebase to do some server side processing. Do these make sense?
- Is it possible to have one development goal that starts a servlet container that could serve both the client host page as well as the GWT code server for super dev mode? Right now I run the code server out of the client module and a jetty instance (jetty:run) separately out of the static content module, but development could be a little easier than making this extra step.
- I'm getting many errors when running gwt:compile on my client module like this: "Errors in 'jar:file:/Users/me/.m2/repository/com/google/gwt/gwt-dev/2.8.0-SNAPSHOT/gwt-dev-2.8.0-SNAPSHOT.jar!/com/google/gwt/dev/util/arg/OptionExtraDir.java' Line 28: No source code is available for type java.io.File; did you forget to inherit a required module?" so I've probably missed something in my pom.xml, but am not seeing it. I've included my top level, client and web pom.xml files, in case that helps.
Thanks for any help getting started on this, or other tips that might be useful. I feel like not many people have gone down a similar path, but maybe there will be others in the future after GWT 2.8 is released and people get into Polymer and Firebase.
(Note: groupId and artifactId below are given for example purposes)
/pom.xml (top level)
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myproject</groupId>
<artifactId>myproject</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gwt.version>2.8.0-SNAPSHOT</gwt.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<mavenVersion>3.0</mavenVersion>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>${gwt.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<moduleName>mymodule</moduleName>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.11.v20150529</version>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<extensions>true</extensions>
<configuration>
<sourceLevel>${maven.compiler.source}</sourceLevel>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>my-client</module>
<module>my-web</module>
</modules>
</project>
/my-client/pom.xml (contains GWT client code)
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>myproject</groupId>
<artifactId>myproject</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>myproject-client</artifactId>
<packaging>gwt-app</packaging>
<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<moduleName>mymodule</moduleName>
<moduleShortName>mymodule</moduleShortName>
</configuration>
</plugin>
</plugins>
</build>
</project>
/my-web/pom.xml (contains host page and static content)