﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-j2ee绿洲-文章分类-AppFuse</title><link>http://www.blogjava.net/livery/category/34458.html</link><description>找到属于自己的一片天空</description><language>zh-cn</language><lastBuildDate>Sat, 06 Sep 2008 01:21:45 GMT</lastBuildDate><pubDate>Sat, 06 Sep 2008 01:21:45 GMT</pubDate><ttl>60</ttl><item><title>AppFuse初探</title><link>http://www.blogjava.net/livery/articles/227354.html</link><dc:creator>心情经纬</dc:creator><author>心情经纬</author><pubDate>Fri, 05 Sep 2008 22:30:00 GMT</pubDate><guid>http://www.blogjava.net/livery/articles/227354.html</guid><wfw:comment>http://www.blogjava.net/livery/comments/227354.html</wfw:comment><comments>http://www.blogjava.net/livery/articles/227354.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livery/comments/commentRss/227354.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livery/services/trackbacks/227354.html</trackback:ping><description><![CDATA[AppFuse
是一个开源项目，主要目的是使用开源工具来帮助开发者快速有效的建立Web应用项目。使用AppFuse可以减少开发人员在建立新web应用时候花费大量
时间在项目结构的建立上。 最核心的是, AppFuse是一个项目的骨架，类似图使用IDE的向导方式来创建web项目。<br />
AppFuse 2 的环境配置：<br />
&nbsp;a. 安装JDK 5+ (确保JAVA_HOME 指向JDK目录,&nbsp;而不是JRE目录).<br />
&nbsp;b.&nbsp;安装 MySQL 5.x.<br />
&nbsp;c. 建立本地SMTP服务或者修改mail.properties (在src/main/resources) 的use为一个不同的主机名- it&nbsp;缺省是 "localhost".<br />
&nbsp;d. 安装Maven 2.0.9+.<br />
因为AppFuse 2使用了Maven 2 的支持。一般的Maven2 会再你使用AppFuse的包的时候会下载这些包，但是如果你的网络不好的话。你也可以自己下载AppFuse2的依赖包，其下载地址为：<a href="https://appfuse.dev.java.net/servlets/ProjectDocumentList?folderID=9173&amp;expandFolder=9173&amp;folderID=9173">https://appfuse.dev.java.net/servlets/ProjectDocumentList?folderID=9173&amp;expandFolder=9173&amp;folderID=9173</a>，现在版本是AppFuse2.02.大小为80M多。<br />
然后解压到某个文件夹下，然后修改Maven_Home下的/conf/settings.xml里的相应配置，设置本地资源库。 <br />
&lt;!-- localRepository<br />
&nbsp;&nbsp;&nbsp; The path to the local repository maven will use to store artifacts.<br />
&nbsp;&nbsp;&nbsp; Default: ~/.m2/repository<br />
&nbsp; &lt;localRepository&gt;/path/to/local/repo&lt;/localRepository&gt;<br />
&nbsp; --&gt;<br />
&nbsp; &lt;localRepository&gt;E:/appfusedeps/repository&lt;/localRepository&gt;<br />
<p>需要注意的上面的配置里说默认的资源库路径为~/.m2/repository，这是指用户的home目录，但如果这样设置在windows下，会
产生一些问题，因为windows的用户目录在C:\Documents and
Settings下，而这个目录有空格，所以最好直接指定另外的没有空格的英文路径。</p>
&nbsp;下面是创建不同种类项目的Archetype Command：<br />
1.JSF Basic <br />
&nbsp;&nbsp; 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 <br />
2.Spring MVC Basic <br />
&nbsp; 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 <br />
3. Struts 2 Basic <br />
&nbsp; 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 <br />
4. Tapestry Basic <br />
&nbsp; 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 <br />
5. JSF Modular <br />
&nbsp; 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 <br />
6.Spring MVC Modular <br />
&nbsp; 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 <br />
7.Struts 2 Modular <br />
&nbsp; 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 <br />
8.Tapestry Modular <br />
&nbsp; 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 <br />
9.Core(backend only)<br />
&nbsp;&nbsp; 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<br />
下面将举一个例子：<br />
1. 在D盘创建一个目录D:\projects\<br />
2. 启动cmd。进入目录D:\projects\.<br />
3.执行如下建构命令创建基本的：<br />
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<br />
4.执行结束后将会看到D:\projects\myproject目录结构,编辑D:\projects\myproject\pom.xml，修改mysql数据连接信息，主要是修改root的密码为你自己数据库用户密码<br />
因为缺省为空&lt;jdbc.password&gt;&lt;/jdbc.password&gt;。<br />
5.在cmd中进入目录D:\projects\myproject<br />
6.执行mvn jetty:run-war<br />
7.等执行结束后，在浏览器地址栏输入<a href="http://localhost:8080/">http://localhost:8080/</a>,你将会看到项目的界面，任意输入一个用户名和密码即可登入。<br />
<img src="http://www.blogjava.net/images/blogjava_net/livery/a.JPG" alt="" border="0" /><br />
8.登入进去以后，不错吧。你的新项目不写一行代码就完成了吧。呵呵。<br />
<br />
<img src ="http://www.blogjava.net/livery/aggbug/227354.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livery/" target="_blank">心情经纬</a> 2008-09-06 06:30 <a href="http://www.blogjava.net/livery/articles/227354.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>