使用工具创建GWT Maven Project有两种方式,使用GWT Command-line Tools和Maven GWT Plugin。
要使用webAppCreator命令,
运行
webAppCreator -help
WebAppCreator [-overwrite] [-ignore] [-templates template1,template2,...] [-out dir] [-junit pathToJUnitJar] [-maven] [-noant] moduleName
where
-overwrite Overwrite any existing files
-ignore Ignore any existing files; do not overwrite
-templates Specifies the template(s) to use (comma separeted). Defaults to 'sample,ant,eclipse,readme'
-out The directory to write output files into (defaults to current)
-junit Specifies the path to your junit.jar (optional)
-maven Deprecated. Create a maven2 project structure and pom file (default disabled). Equivalent to specifying 'maven' in the list of templates.
-noant Deprecated. Do not create an ant configuration file. Equivalent to not specifying 'ant' in the list of templates.
and
moduleName The name of the module to create (e.g. com.example.myapp.MyApp)
如果要创建一个纯净的maven project,要用到-maven参数,还要指定GWT module name。
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.0 -DgroupId=com.martian -DartifactId=gwtmavenproject -Dversion=1.0-SNAPSHOT -Dmodule=MainPanel -DinteractiveMode=false