Appfuse搭建过程(下源代码不须要maven,lib直接就在项目里(否则痛苦死!))

什么是Appfuse:AppFuse是一个集成了众多当前最流行开源框架与工具(包含Hibernate、ibatis、Struts、Spring、DBUnit、Maven、Log4J、Struts Menu、Xdoclet、SiteMesh、OSCache、JUnit、JSTL等(如今还有lucene的,无敌了))于一身的Web开发框架。AppFuse提供了Web系统开发过程中都须要开发的一些功能。如登陆、用户密码加密,用户管理、依据不同的用户能够展现不同的菜单.J2EE开发人员也能够在此基础上开发加入自己的功能模块。利用这个框架能够大幅度的提高开发速度。 
      搭建步骤(2014-04-21更新)例如以下:

1. 下个Maven配上环境变量,要配过JAVA_HOME的环境变量;安装mysql。数据库实例的语言要设置为utf-8,用户名root,密码空


2. 到官网http://appfuse.org/display/APF/AppFuse+QuickStart去依据须要复制Appfuse的版本号。z*f有时候会屏蔽国外站点,有时候訪问不到,所以粘贴下我的:mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts-archetype -DarchetypeVersion=3.0.0 -DgroupId=com.zf -DartifactId=appfusestruts -DarchetypeRepository=http://oss.sonatype.org/content/repositories/appfuse


3. 開始->cmd->把上边的命令粘上。执行,自己主动下载(很慢),建议改动Maven的中国镜像地址(不同区域好像速度有一定区别);


4. 在cmd中cd 到检出的文件夹(我自己定义的叫appfusestruts)下 在执行mvn appfuse:full-source和mavn install完了之后再执行mvn  eclipse:eclipse 导入eclipse。废话完(以上都是能够从网上找到的,下边的网上找不到(拼不到))。

5.eclipse会报错,jsp和xml的校验,能够忽略。


6.选择项目的properties->Project Faccets ->Dynamic Web Module->点击下边出现的超链接配置文件夹到srcmainwebapp


7.选择项目的properties-> Java Build Path->Source->把src/main/java和src/main/resources之外的路径全删了,把Default output folder改为 “项目名称/src/main/webapp/WEB-INF/classes

将 target\%项目名称%-1.0-SNAPSHOTWEB-INFlib 文件夹下的类库 copy 到 srcmainwebappWEB-INFlib 文件夹下。

  


8. 选择项目的properties-> Deployment Assembly->Add->引用的java build path entries中146个jar所有选中ok。假设要部署tomcat。就反选jsp2.0-api.jar 


9.加入到tomcat,部署到tomcat安装路径下 publish


10.改动jdbc.properties为 
#jdbc.driverClassName=${jdbc.driverClassName}
#jdbc.url=${jdbc.url}
#jdbc.username=${jdbc.username}
#jdbc.password=${jdbc.password}
#jdbc.validationQuery=${jdbc.validationQuery}
#
#hibernate.dialect=${hibernate.dialect}
#
# Needed by Hibernate3 Maven Plugin defined in pom.xml
#hibernate.connection.username=${jdbc.username}
#hibernate.connection.password=${jdbc.password}
#hibernate.connection.url=${jdbc.url}
#hibernate.connection.driver_class=${jdbc.driverClassName}

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/appfusezfhost?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=
jdbc.validationQuery= SELECT 1 + 1

hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

# Needed by Hibernate3 Maven Plugin defined in pom.xml
hibernate.connection.username=root
hibernate.connection.password=
hibernate.connection.url=jdbc:mysql://localhost/appfusezfhost?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
hibernate.connection.driver_class=com.mysql.jdbc.Driver

保存后执行tomcat有乱码:
复制 ApplicationResources_zh_CN.properties中内容到http://www.yuendong.com/info.asp?id=160转换后从ascii框中复制粘贴到ApplicationResources_zh_CN.properties。就ok了。能够通过eclipse插件“property editor”去浏览配置文件。



lucene报错

ctrl+H搜索app.search.index.basedir 。“=”后的全改成一个固定地址就ok了


源码下载地址(50多mb有点大。可是包含了jar包。不须要maven直接impot就能用)


原文地址:https://www.cnblogs.com/mqxnongmin/p/10686023.html