GWT开发 - 创建GWT Maven Project
2012-12-03 00:45
309 查看
使用工具创建GWT Maven Project有两种方式,使用GWT Command-line Tools和Maven GWT Plugin。
运行
webAppCreator -help
先创建你的项目目录,例如gwtmavenproject
在目录中运行:webAppCreator -maven com.martian.gwtmavenproject.MainPanel,com.martian.gwtmavenproject.MainPanel是moduleName,com.martian.gwtmavenproject是entry-point
module的位置,同时pom文件也以com.martian.gwtmavenproject作为groupId、MainPanle作为artifactId
可能你需要修改一下pom文件中的groupId和artifactId
groupId=com.martian
artifactId=gwtmavenproject
version=1.0
gwtModuleName=MainPanel
运行
注意:
请注意,WebAppCreator -maven 已经被丢弃,不推荐使用!
1. 使用GWT Command-line Tools创建maven project
要使用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。
先创建你的项目目录,例如gwtmavenproject
在目录中运行:webAppCreator -maven com.martian.gwtmavenproject.MainPanel,com.martian.gwtmavenproject.MainPanel是moduleName,com.martian.gwtmavenproject是entry-point
module的位置,同时pom文件也以com.martian.gwtmavenproject作为groupId、MainPanle作为artifactId
可能你需要修改一下pom文件中的groupId和artifactId
2. 使用Mave GWT Plugin创建maven project
假设我们要创建一个maven project,有以下条件groupId=com.martian
artifactId=gwtmavenproject
version=1.0
gwtModuleName=MainPanel
运行
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
注意:
请注意,WebAppCreator -maven 已经被丢弃,不推荐使用!
相关文章推荐
- Maven创建 module和project的区别
- idea开发系列教程(-)-创建maven webapp项目
- Eclipse—怎样为Eclipse开发工具中创建的JavaWebproject创建Servlet
- GWT开发 - 开发环境搭建 Maven+Eclipse+Tomcat
- 开发环境配置(Eclipse,Maven,GWT)
- eclipse中集成svn maven开发手册---创建提分支
- 如何使用maven2.0插件创建一个java project
- 如何用Maven构建一个project(二)—创建Web项目
- 使用Eclipse-Maven-git做Java开发(5)--Eclipse的Java项目的创建过程
- IntelliJ创建基本的Maven Web project
- maven3常用命令\创建Project
- 问题记录一:eclipse 创建maven项目的时候总是提示invalid project description
- Maven创建 module和project的区别
- 用maven创建一个Web project
- eclipse平台下geotools应用开发环境(创建maven项目)
- idea创建maven项目失败, Failed to create a Maven project:'D:/xxx' already exists in VFS
- 创建maven项目报错Unable to create project from archetype
- intellij idea 开发中,创建Maven项目中的子模块以及相关错误解决
- 创建maven parent project & module project