初学appfuse

首先安装配置maven,参考maven->学习maven.
http://lwj9922.iteye.com/admin/blogs/165651
(记得修改setting.xml)
之后开始appfuse。
参考 http://appfuse.org/display/APF/AppFuse+QuickStart
我选择 Struts 2 Basic 创建工程。
doc窗口操作: 在要放工程的的目录下 输入
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject
其中 groupId是包名 artifactId=项目名

修改项目里pom.xml中的数据库配置(密码)
之后切换到项目目录 cd myproject .
输入mvn appfuse:full-source 下载源代码
mvn jetty:run-war 进行debug。(这里都是下载的代码和数据库部分。没有自己建立的数据库,如果在数据库里建立表,http://localhost:8080就会出现表里内容的 增加 删除 编辑 操作)


如果有数据库 mvn appfuse:gen-model生成model.
要生成dao service类,需要修改pom.xml 把<amp.genericCore>改为 false.
运行mvn appfuse:gen 填写pojoName就可以了.
之后mvn appfuse:install;  mvn jetty:run-war就可以通过http://localhost:8080看了

下载maven的eclipse插件
1、打开eclipse
2、打开菜单 help -Software updates-Find and Install
3、选择第二项,进入下一步
4、点击按钮“New Remote Site…”
5、在Name中输入:Maven2,在URL中输入http://m2eclipse.codehaus.org/
按提示走。
6、window->preferences->java->build path->classpath variables->new..
name:M2_REPO
path:maven的仓库目录 如:D:/tools/apache-maven-2.0.8/local/repo



你可能感兴趣的:(eclipse,maven,xml,struts,Appfuse)