Appfuse 教程
AppFuse 是一个开源项目,主要目的是使用开源工具来帮助开发者快速有效的建立Web应用项目。使用AppFuse可以减少开发人员在建立新web应用时候花费大量时间在项目结构的建立上。 最核心的是, AppFuse是一个项目的骨架,类似图使用IDE的向导方式来创建web项目。
AppFuse 2 的环境配置:
a. 安装JDK 5+ (确保JAVA_HOME 指向JDK目录, 而不是JRE目录).
b. 安装 MySQL 5.x.
c. 建立本地SMTP服务或者修改mail.properties (在src/main/resources) 的use为一个不同的主机名- it 缺省是 "localhost".
d. 安装Maven 2.0.9+.
因为AppFuse 2使用了Maven 2 的支持。一般的Maven2 会再你使用AppFuse的包的时候会下载这些包,但是如果你的网络不好的话。你也可以自己下载AppFuse2的依赖包,其下载地址为:https://appfuse.dev.java.net/servlets/ProjectDocumentList?folderID=9173&expandFolder=9173&folderID=9173,现在版本是AppFuse2.02.大小为80M多。
然后解压到某个文件夹下,然后修改Maven_Home下的/conf/settings.xml里的相应配置,设置本地资源库。
<!-- localRepository
The path to the local repository maven will use to store artifacts.
Default: ~/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>E:/appfusedeps/repository</localRepository>
需要注意的上面的配置里说默认的资源库路径为~/.m2/repository,这是指用户的home目录,但如果这样设置在windows下,会产生一些问题,因为windows的用户目录在C:\Documents and Settings下,而这个目录有空格,所以最好直接指定另外的没有空格的英文路径。
下面是创建不同种类项目的Archetype Command:
1.JSF Basic
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
2.Spring MVC Basic
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
3. Struts 2 Basic
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
4. Tapestry Basic
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
5. JSF Modular
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
6.Spring MVC Modular
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
7.Struts 2 Modular
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
8.Tapestry Modular
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
9.Core(backend only)
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-core -DremoteRepositories=http://static.appfuse.org/releases-DarchetypeVersion=2.0 -DgroupId=com.mycompany.app -DartifactId=myproject
下面将举一个例子:
1. 在D盘创建一个目录D:\projects\
2. 启动cmd。进入目录D:\projects\.
3.执行如下建构命令创建基本的:
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteReposities=http://static.appfuse.org/release -Darchetypeversion=2.0.1 -DgroupId=com.zhangjr.framework -DartifactId=myproject
4.执行结束后将会看到D:\projects\myproject目录结构,编辑D:\projects\myproject\pom.xml,修改mysql数据连接信息,主要是修改root的密码为你自己数据库用户密码
因为缺省为空<jdbc.password></jdbc.password>。
5.在cmd中进入目录D:\projects\myproject
6.执行mvn jetty:run-war
7.等执行结束后,在浏览器地址栏输入http://localhost:8080/,你将会看到项目的界面,任意输入一个用户名和密码即可登入。
8.登入进去以后,不错吧。你的新项目不写一行代码就完成了吧。呵呵。
9.你可以运行mvn appfuse:full-source,则会创建数据库,并且生成代码。
Appfuse 教程相关推荐
- 【转】 使用 AppFuse 快速构建 J2EE 应用
文档选项 未显示需要 JavaScript 的文档选项 打印本页 将此页作为电子邮件发送 样例代码 级别: 中级 沈 锐 (shenrui@cn.ibm.com), 软件工程师, IBM CSDL 2 ...
- 使用 AppFuse 的七个理由之二
理由 1:测试 测试是在软件开发项目中很少被给予足够信任的一个环节.注意我并不是说在软件开发的一些刊物中没有得到足够的信任!很多文章和案例研究都给出了测试优先的开发方式和足够的测试覆盖面以提高软件的质 ...
- 使用 AppFuse 的七个理由(中英文两版)
使用 AppFuse 的七个理由 学习 Java 开放源码工具 -- 并使用这些工具提高生产效率 文档选项 <script language="JavaScript" typ ...
- 船长的AppFuse2.0学习进程
以本文记录船长本人学习AppFuse的进程. 船长的AppFuse2.0学习进程 2007.10.18:下载.安装.设置了maven2.0,下载了appfuse2.0,相应调整了maven2.0,下载 ...
- Appfuse下载及安装步骤
Appfuse下载及安装步骤 AppFuse是一个集成了众多当前最流行开源框架与工具(包括Hibernate.ibatis.Struts.Spring.DBUnit.Ant.Log4J.Struts ...
- AppFuse项目笔记(1)
AppFuse项目笔记(1) 一.Appfuse简介 Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring.Hibernate.ibatis.s ...
- 【书籍】C++经典教程
[书籍]C++经典教程 要下载请登录通了电123课件站(http://www.told123.cn)计科里面进行下载或者直接在通了电进行搜索[推荐]. [书籍]C++经典教程 [书籍]C++编 ...
- J2EE开发平台:Eclipse之Appfuse浅析
很久没来更新过Blog了,工作忙啊,从J2ME转换到J2EE,需要学习的东西好好多啊,再加上这两年纷至沓来的各种框架,简直让人有点目不暇接啊,但是,没办法啊,所有的用人单位都需要你这个的会,那个也得会 ...
- 使用Docker搭建svn服务器教程
使用Docker搭建svn服务器教程 svn简介 SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很 ...
最新文章
- NTPDATE - no server suitable for synchronization found 修复
- EF6 CodeFirst+Repository+Ninject+MVC4+EasyUI实践(六)
- setdefaultencoding函数使用详解
- Python自动化之django的ORM
- DB2在linux安装
- FreeRTOS学习笔记——互斥型信号量
- java读写html文件时出现中文乱码问题的解决方法
- 框架升级后某个类型所在程序集发生转移,应用还能正常运行吗?
- 小米汽车总部正式落户北京,注册地为北京经济技术开发区
- pytorch torch.reshape
- 如何让linux自动回收内存,linux – 什么可以导致非活动内存增加以及如何回收它?...
- 开源风云 20 年!
- java数组怎么添加元素_Java封装数组之添加元素操作实例分析
- 常用PDF编辑工具 Adobe Acrobat、PDF-XChange Editor 、福昕PDF编辑器、PDFelement
- C语言程序——标准输出格式
- 【SW】利用3D打印机打印 PCB 钢网的方法
- 中华传统吉祥图案集锦
- docker启动redis指定redis.conf参数
- SpringBoot 项目修改html后不需要重新启动(热部署)
- pgAdmin4 汉化