首先安装maven,http://maven.apache.org/download.html , 当前最新的是3.0.3, 下载解压, 设置环境变量,打开终端, 测试是否安装成功,mvn -v, 如果显示相应的版本, 则安装成功。
-
在http://appfuse.org/display/APF/AppFuse+QuickStart 中选择要生成的类型
如下
输入相应的项, Command Line:
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-jsf-archetype -DarchetypeVersion=2.1.0 -DgroupId=com.nelson -DartifactId=appjsf -DarchetypeRepository=http://oss.sonatype.org/content/repositories/appfuse
- 打开终端输入Command Line中的值,漫长的等待, 下载jar包, 下载成功进入第3步
-
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
如果想下载源码 , 加-DdownloadSources=true,像这样mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse -DdownloadSources=true
- Import 到eclipse中,结构图 ,接下来
看下mvn dependency:tree
tree部分, 也可以用
, 列出所以 dependencymvn dependency:list
- 打开pom.xml, 查找org.hibernate.dialect.MySQL5InnoDBDialect, 如果你的Mysql没有设置密码, 则不用修改, 如果有, 设置<jdbc.password>your_pwd</jdbc.password>
- 在appjsf目录下打开终端, 运行mvn jetty:run
- 打开浏览器http://localhost:8080/appjsf
- OK, admin用户admin/admin, 普通用户user/user, 到处点击, 看看它的功能吧。:)
资料参考:
- http://www.ibm.com/developerworks/cn/java/j-lo-appfuse/
- http://www.josdoc.com/html/JEEkuangjia/Appfuse/rumenjiaocheng/200905/02-523.html
- http://appfuse.org/display/APF/Reference+Guide