appfuse配置说明

appfuse安装完全按照官网即可。

http://appfuse.org/display/APF/AppFuse+QuickStart

关于appfuse安装完成后

1、先调用mvnappfuse:full-config,将项目从"embeddedmode"修改为"full-sourcemode"。然后mvnjetty:run运行。如果运行不成功,一些常见问题的解决方案如下:

  • maven3有BUG,如果pom.xml没有自动生成版本数据,需要手动录入(如<velocity.version>1.4</velocity.version>),注意手动去找!汗~
  • hibernate.properties设置app.search.index.basedir=${project.build.outputDirectory}/index
  • 如果mvncompile遇到java版本冲突,pom.xml查看maven-compiler-plugin的版本设置;再看eclipse中javacompiler

2、没必要在eclipse中集成maven插件,没什么用,直接命令行运行mvnjetty:run

扩展:http://docs.codehaus.org/display/JETTY/Debugging+with+the+Maven+Jetty+Plugin+inside+Eclipse[注意:若集成maven插件,在eclipse.ini中给maven配置外部jdk。(--vm...)]

3、pom.xml

  • 修改mysql的JDBC密码
  • 依赖包下载完成后maven\conf下的setting.xml设置<offline>true</offline>
  • hibernate3-maven-plugin,dbunit-maven-plugin,修改<skip>true</skip>,运行时自动跳过数据库自动创建表等功能。详见:http://ll-feng.iteye.com/blog/221252
  • 页面编码问题,对pom.xml文件如下设置<resources>

<resource>

<directory>src/main/resources</directory>

<excludes>

<exclude>ApplicationResources_de.properties</exclude>

<exclude>ApplicationResources_fr.properties</exclude>

<exclude>ApplicationResources_ko.properties</exclude>

<exclude>ApplicationResources_nl.properties</exclude>

<exclude>ApplicationResources_no.properties</exclude>

<exclude>ApplicationResources_pt*.properties</exclude>

<exclude>ApplicationResources_tr.properties</exclude>

<exclude>*_zh*.properties</exclude>

<exclude>applicationContext-resources.xml</exclude>

<exclude>struts.xml</exclude>

</excludes>

<filtering>true</filtering>

</resource>

4、appfuse工程中的pom带有velocity,配置时在web.xml加上相应的servlet即可

5、应用开发中,为url设置访问权限,注意配置security.xml

6、规范流程,每个method必须写单元测试,参考http://appfuse.org/display/APF/Using+Struts+2

相关推荐