Basic usage
-
Add the plugin to your POM, enabling extensions to get the new packagings, and configuring your module name:
<plugin> <groupId>net.ltgt.gwt.maven</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>1.2.0</version> <extensions>true</extensions> <configuration> <moduleName>com.example.app.App</moduleName> </configuration> </plugin> -
Set your
<packaging>to eithergwt-liborgwt-app -
Add dependencies on GWT
<dependencyManagement> <dependencies> <dependency> <groupId>org.gwtproject</groupId> <artifactId>gwt</artifactId> <version>2.12.2</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.gwtproject</groupId> <artifactId>gwt-user</artifactId> </dependency> <dependency> <groupId>org.gwtproject</groupId> <artifactId>gwt-dev</artifactId> </dependency> </dependencies> -
Manage your module in a
src/main/module.gwt.xmlfile. It will be processed and copied to the appropriate place and with the appropriate name according to the configured module name by thegwt:generate-modulegoal. This can be disabled by setting theskipModuleconfiguration property totrue.
Project layout
The default configuration of goals provided by the Maven Plugin for GWT expect the following project layout:
| File or directory | Usage |
|---|---|
src/main/module.gwt.xml |
GWT module definition, used by gwt:generate-module. The rename-to="" and some <inherits/> will be generated. |
src/main/java/ |
Standard Java sources |
src/main/resources/ |
Standard resources |
src/main/super/ |
GWT super-sources, used by gwt:add-super-sources |
src/test/java/ |
Standard test Java sources |
src/test/resources/ |
Standard test resources |
src/test/super/ |
GWT test super-sources, used by gwt:add-test-super-sources |
GWT Version Compatibility
Given its design, the Maven Plugin for GWT should be compatible with a wide range of GWT versions. It is automatically tested against the latest two stable versions of GWT and the latest snapshot. At this time, the latest stable version is 2.12.2.
