﻿<?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-程序人生-文章分类-appfuse</title><link>http://www.blogjava.net/caihualin/category/27654.html</link><description>我们站在同一起跑线上,让我们共同努力,共同奋进,愿您的人生因程序而美好!</description><language>zh-cn</language><lastBuildDate>Sat, 24 May 2008 23:20:09 GMT</lastBuildDate><pubDate>Sat, 24 May 2008 23:20:09 GMT</pubDate><ttl>60</ttl><item><title>AppFuse 2.0 快速起步</title><link>http://www.blogjava.net/caihualin/articles/202416.html</link><dc:creator>蔡华林</dc:creator><author>蔡华林</author><pubDate>Fri, 23 May 2008 07:31:00 GMT</pubDate><guid>http://www.blogjava.net/caihualin/articles/202416.html</guid><wfw:comment>http://www.blogjava.net/caihualin/comments/202416.html</wfw:comment><comments>http://www.blogjava.net/caihualin/articles/202416.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/caihualin/comments/commentRss/202416.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/caihualin/services/trackbacks/202416.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
&nbsp;
<p style="text-align: left" align="left"><strong><span style="font-size: 18pt; color: #4e4e4e; font-family: 宋体">AppFuse 2.0 </span></strong><strong><span style="font-size: 18pt; color: #4e4e4e; font-family: 宋体">快速起步</span></strong></p>
<p style="text-align: left" align="left">&nbsp;<span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">英文版网址</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 'Arial','sans-serif'">:<a href="http://appfuse.org/display/APF/AppFuse+QuickStart"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://appfuse.org/display/APF/AppFuse+QuickStart</span></a></span></p>
<p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">请依照以下步骤开始使用AppFuse开发Java EE应用程序：</span></p>
<p style="background: #eeeeee; text-align: left" align="left"><strong><span style="font-size: 12pt; color: #003366; font-family: 宋体">目录</span></strong></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">1.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><a href="http://appfuse.org/display/APF/AppFuse+QuickStart#AppFuseQuickStart-create#AppFuseQuickStart-create"><span style="color: black; text-decoration: none; text-underline: none">建立</span></a></span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">一个新项目. </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">2.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><a href="http://appfuse.org/display/APF/AppFuse+QuickStart#AppFuseQuickStart-run#AppFuseQuickStart-run"><span style="color: black; text-decoration: none; text-underline: none">运行</span></a>. </span></p>
<p style="background: #eeeeee; text-align: left" align="left"><strong><span style="font-size: 12pt; color: #003366; font-family: 宋体">建立项目</span></strong></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">1.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><a href="http://java.sun.com/javase/downloads/"><span style="color: black; text-decoration: none; text-underline: none">下载</span></a></span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">安装JDK 5+. </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">2.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads"><span style="color: black; text-decoration: none; text-underline: none">下载</span></a></span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">安装MySQL 5.x. </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">3.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">设置一个本地的<a title="Installing an SMTP Server" href="http://appfuse.org/display/APF/Installing+an+SMTP+Server"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">SMTP <span style="color: black; text-decoration: none; text-underline: none">服务器</span></a></span>或者修改</span><span style="font-size: 12pt; color: #4e4e4e; font-family: 宋体">mail.properties</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">文件(位于</span><em><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体; letter-spacing: 0.75pt">src/main/resources</span></em><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">) </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">来使用其它的主机名-默认使用"localhost". </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">4.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><a href="http://maven.apache.org/download.html"><span style="color: black; text-decoration: none; text-underline: none">下载</span></a>&nbsp;<a href="http://maven.apache.org/download.html#Installation"><span style="color: black; text-decoration: none; text-underline: none">安装</span></a>Maven 2.0.8. </span></p>
<div align="center">
<table style="background: #ffffce; margin-left: 36pt; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">如果你更喜欢使用Eclipse 来建立项目，而不是命令行,可以参考<a href="http://candy4appfuse.sourceforge.net/"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">Candy for AppFuse</a>.</span></span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">5</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">、下载appfuse2.0.1并解压appfuse<br />
<a href="https://appfuse.dev.java.net/files/documents/1397/77082/appfuse-dependencies-2.0.1.zip" target="_blank"><span style="color: #4e4e4e; text-decoration: none; text-underline: none">https://appfuse.dev.java.net/files/documents/1397/77082/appfuse-dependencies-2.0.1.zip</a><br />
</span>假定解压到D:/appfuse2.0/repository下</span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">6</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">、修改%maven_home%/conf/settings.xml<br />
修改settings.xml中的localRepository，指向appfuse的解压目录<br />
&lt;settings&gt;<br />
&nbsp; &lt;!&#8211; localRepository<br />
&nbsp; | The path to the local repository maven will use to store artifacts.<br />
&nbsp; | Default: ~/.m2/repository<br />
&nbsp; &#8211;&gt;<br />
&nbsp; &lt;localRepository&gt;D:/appfuse2.0/repository&lt;/localRepository&gt;</span></p>
<p><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><br />
</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">修改原因：默认情况下 repository 在 C:"Documents and Settings"</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">$USER_HOME ".m2"repository </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">，因为这个路径中包含一个空格,所以在后续使用 mvn appfuse:full-source 命令的时候会产生异常； <br />
<br />
</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] Scanning for projects...</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] Searching repository for plugin with prefix: 'appfuse'.</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] ------------------------------------------------------------------------</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] Building AppFuse Modular Application - Core</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO]&nbsp;&nbsp;&nbsp; task-segment: [appfuse:full-source]</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] ------------------------------------------------------------------------</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] ------------------------------------------------------------------------</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[ERROR] FATAL ERROR</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] ------------------------------------------------------------------------</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] null</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Illegal character in path at index 18: file:/C:/Documents and Settings/Administrator/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] ------------------------------------------------------------------------</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">[INFO] Trace</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">java.lang.IllegalArgumentException</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URI.create(URI.java:842)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.reflect.Method.invoke(Method.java:597)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.setAntLib(Project.java:313)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.initProperties(Project.java:309)</span></p>
<p style="text-align: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.apache.tools.ant.Project.init(Project.java:295)</span></p>
<p style="text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">官方解决地址http://www.nabble.com/Re%3A-problem-with-appfuse%3Agen-in-windows-p13974654s2369.html <br />
<br />
意思是讲是ant的bug，里面不能有空格，因为Documents and Settings里面有空格所以报错。 </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><br />
</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">另外，由于ant 1.7存在的bug（Problem with appfuse:gen in windows ），因此如果用的是ant 1.7，确认一下$USER_HOME/.m2/repository是否存在，不存在手工创建，并把修改后的settings.xml 拷贝到~".m2"repository下不然在执行后续操作mvn appfuse:full-source时候会报如下错误<br />
java.lang.IllegalArgumentException: When not aligning with a user install you mu<br />
st specify a local repository location using the setLocalRepositoryDirectory( Fi<br />
le ) method.<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.embedder.MavenEmbedder.createMavenSettings(MavenEmbe<br />
dder.java:699)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:628)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In<br />
stallSourceMojo.java:341)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In<br />
stallSourceMojo.java:303)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.appfuse.mojo.installer.InstallSourceMojo.execute(InstallSourceMoj<br />
o.java:142)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi<br />
nManager.java:443)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa<br />
ultLifecycleExecutor.java:539)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone<br />
Goal(DefaultLifecycleExecutor.java:493)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau<br />
ltLifecycleExecutor.java:463)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan<br />
dleFailures(DefaultLifecycleExecutor.java:311)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen<br />
ts(DefaultLifecycleExecutor.java:278)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi<br />
fecycleExecutor.java:143)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br />
java:39)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces<br />
sorImpl.java:25)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at java.lang.reflect.Method.invoke(Method.java:585)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; at org.codehaus.classworlds.Launcher.main(Launcher.java:375)<br />
[INFO] ————————————————————————</span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">7</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">．AppFuse拥有很多构造不同风格项目的能力. 为使用户使用起来更优化、更简单, 我们建立了多种原型（又称作：起始项目）. 现在又两种类型的AppFuse 原型:基本的（basic）和模块化的（modular）. 基本原型用于建立基于web应用的项目；模块化原型包含&#8220;核心&#8221;（core）"和"web"模块，用于后台可复用的项目。下表中的命令是用于产生其实项目的，改变</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">groupId</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">就定制包名（package name）；改变</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">artifactId</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">来定制项目名（project's name）. 进入D:"java"workspace,<em>运行如下命令，生成struts2.0的项目<br />
<br />
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.1 -DgroupId=cn.net.xinyi.nvs -DartifactId=nvs3000</em></span></p>
<div align="center">
<table style="background: #ddffdd; margin-left: 36pt; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">在建立原型过程中，是会看到一些警告信息输出。如果在输出信息的末尾看到了&#8220;</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">BUILD SUCCESSFUL</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">&#8221;</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">字样，那就意味着你的项目建立成功了。</span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<table style="margin-left: 36pt; border-collapse: collapse" cellspacing="0" cellpadding="0" border="0">
    <tbody>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: #b2b2b2 1pt dotted; padding-left: 3pt; background: whitesmoke; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: center" align="center"><strong><span style="font-size: 12pt; color: #4e4e4e; font-family: 宋体">Archetype</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: #b2b2b2 1pt dotted; padding-left: 3pt; background: whitesmoke; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: center" align="center"><strong><span style="font-size: 12pt; color: #4e4e4e; font-family: 宋体">Command</span></strong></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">JSF Basic</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Spring MVC Basic</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Struts 2 Basic</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Tapestry Basic</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">JSF Modular</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Spring MVC Modular</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Struts 2 Modular</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Tapestry Modular</span></strong></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
        <tr>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: #b2b2b2 1pt dotted; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">Core</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"> <br clear="all" />
            (backend only) </span></p>
            </td>
            <td style="border-right: #b2b2b2 1pt dotted; padding-right: 3pt; border-top: medium none; padding-left: 3pt; padding-bottom: 2.25pt; border-left: medium none; padding-top: 2.25pt; border-bottom: #b2b2b2 1pt dotted">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-core -DremoteRepositories=<a href="http://static.appfuse.org/releases"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://static.appfuse.org/releases</span></a>-DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject</span></p>
            </td>
        </tr>
    </tbody>
</table>
<p style="text-indent: -18pt; line-height: 19.2pt; text-align: center" align="center"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">8.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">如果你安装了<a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">MySQL 5.x</a></span>而且它的root 用户没有设置口令(可以通过update</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">user set password=password('') where user='root'; flush privileges;</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">去掉root的密码)，那你的AppFuse应用就能立即运行起来. 如果你想使用内嵌式的数据库（embedded database）, 我们最近正好增加了一个<a title="Database Profiles" href="http://appfuse.org/display/APF/Database+Profiles"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">Database Profiles</a> </span>文件用于使用H2, HSQLDB等数据库.</span></p>
<div align="center">
<table style="background: #ffffce; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">关于MySQL 安全性</span></strong></p>
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">使用不设置口令的MySQL会导致系统不安全。一旦建立了数据库，可以使用以下命令来设置root用户的口令:<br />
            </span><span style="font-size: 12pt; color: #4e4e4e; font-family: 宋体">mysql --user=root --pass='' mysql -e "update user set password=password('newpw') where user='root'; flush privileges;"</span></p>
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">AppFuse</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">默认使用root用户和空口令，可以编辑项目的pom.xml文件(位于文件末尾)的和 属性，来设置相应的值</span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<p style="background: #eeeeee; text-align: left" align="left"><strong><span style="font-size: 12pt; color: #003366; font-family: 宋体">运行应用程序</span></strong></p>
<p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">现在，运行AppFuse是非常容易得. 一旦建立了原型项目，Maven 就会分别使用<a href="http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">hibernate3</a>and <a href="http://mojo.codehaus.org/dbunit-maven-plugin/"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">dbunit</span></a></span>插件来为你建立并设置数据库.需要你做的只是使用Maven来运行Jetty容器并开始浏览应用了.</span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">1.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">除非你有更好的主意，应该首先把你的项目检入到源码控制服务器中。<a href="http://code.google.com/hosting/"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">Google Code</a></span>提供免费的Subversion 服务, 当然类似的还有很多. </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">2.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">进入命令行， </span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">cd</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">到你的新项目目录，运行</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn integration-test</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">把JARs, Tomcat 和综合测试程序下载到项目里。现在是喝杯咖啡或啤酒和好时机，因为下载和运行测试大约需要5-10分钟. </span></p>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">3.</span><span style="font-size: 7pt; color: #4e4e4e; font-family: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">要浏览应用需在项目目录里运行命令 </span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn jetty:run-war</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"> (</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">对于模块化项目-</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">modular </span></strong><span style="font-size: 9pt; background: #ffffdd; color: #4e4e4e; font-family: 宋体">project, </span><span style="font-size: 9pt; background: #ffffdd; color: #4e4e4e; font-family: 宋体">应在项目的web目录下运行</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn jetty:run-war</span></strong><span style="font-size: 9pt; background: #ffffdd; color: #4e4e4e; font-family: 宋体">命令</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">). Maven </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">将会启动Jetty ，于是就可以在浏览器输入地址<a href="http://localhost:8080/"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">http://localhost:8080/</a></span>来浏览应用了。</span></p>
<div align="center">
<table style="background: #ddffdd; margin-left: 36pt; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">默认的管理用户的用户名和口令是</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">dmin/admin</span></strong><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">，</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">常规用户是</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">user/user</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">。</span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<p style="text-indent: -21pt; line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">4.&nbsp;</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">运行命令 </span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn war:inplace</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">可以覆盖（override）AppFuse的文件.将会只把依赖的WARs文件抽取到</span><em><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体; letter-spacing: 0.75pt">src/main/webapp</span></em><em><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体; letter-spacing: 0.75pt">目录</span></em><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">,</span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">在这里，你可以根据需要改变文件.当你把释放到你的源文件树时，可以运行 </span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn jetty:run</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">命令. 这样一来可以即时修改文件，而Jetty可以根据需要重新装载. 这种方式的唯一的问题是你的项目里的AppFuse将会是不完整("exploded AppFuse"), 会导致更新升级困难.我们推荐在运行命令</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn war:inplace</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">以前，首先将项目检入源码控制系统。这样一来决定哪些文件被保留或删除文件会更容易些. </span></p>
<p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">如果出现内存溢出（OutOfMemory ）错误，请使用</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">jetty:run</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">命令，参照 <a href="http://www.nabble.com/mvn-jetty:run-=%3e-OutOfMemoryError:-PermGen-space-tf3367253s2369.html"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">this mailing list thread</a>. </span></span></p>
<p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">在项目目录里运行命令</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn appfuse:full-source</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">可以将AppFuse的运行模式由内嵌（"embedded mode"）改变为全源码模式（full-source mode）。</span></p>
<div align="center">
<table style="background: #d8e4f1; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">开发环境</span></strong></p>
            <p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">请参照<a title="Development Environment" href="http://appfuse.org/display/APF/Development+Environment"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">development environment</a></span>来了解如何设置你的计算机环境，来开发基于AppFuse的应用开发</span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<div align="center">
<table style="background: #ddffdd; width: 85%" cellspacing="8" cellpadding="0" width="85%" border="0">
    <tbody>
        <tr>
            <td style="padding-right: 3.75pt; padding-left: 3.75pt; background: none transparent scroll repeat 0% 0%; padding-bottom: 3.75pt; padding-top: 3.75pt">
            <p style="line-height: 19.2pt; text-align: left" align="left"><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">改变数据库的设置</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体"><br />
            </span><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">要改变MySQL 数据库的设置，可以简单地修改位于pom.xml末尾的 属性. 参照 <a title="Database Profiles" href="http://appfuse.org/display/APF/Database+Profiles"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">Database Profiles</a> </span>来使用非MySQL的其他数据库.</span></p>
            </td>
        </tr>
    </tbody>
</table>
</div>
<p style="background: #eeeeee; text-align: left" align="left"><strong><span style="font-size: 12pt; color: #003366; font-family: 宋体">应用的部署</span></strong></p>
<p style="line-height: 19.2pt; text-align: left" align="left"><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">可以使用<a title="Eclipse" href="http://appfuse.org/display/APF/Eclipse"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">Eclipse</a>, <a title="IDEA" href="http://appfuse.org/display/APF/IDEA"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">IDEA</span></a> </span>或 <a title="NetBeans" href="http://appfuse.org/display/APF/NetBeans"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">NetBeans</a></span>来部署应用.使用Eclipse,运行 </span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn eclipse:eclipse</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">来生成项目文件. 使用IDEA, 就要使用</span><strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">mvn idea:idea</span></strong><span style="font-size: 9pt; color: #4e4e4e; font-family: 宋体">命令。进一步的介绍请参考<a title="IDEs" href="http://appfuse.org/display/APF/IDEs"><span style="color: black; font-family: 'Trebuchet MS','sans-serif'; text-decoration: none; text-underline: none">IDE Reference Guide</a>.</span></span></p>
<img src ="http://www.blogjava.net/caihualin/aggbug/202416.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/caihualin/" target="_blank">蔡华林</a> 2008-05-23 15:31 <a href="http://www.blogjava.net/caihualin/articles/202416.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>AppFuse快速起步指南</title><link>http://www.blogjava.net/caihualin/articles/164030.html</link><dc:creator>蔡华林</dc:creator><author>蔡华林</author><pubDate>Thu, 29 Nov 2007 08:39:00 GMT</pubDate><guid>http://www.blogjava.net/caihualin/articles/164030.html</guid><wfw:comment>http://www.blogjava.net/caihualin/comments/164030.html</wfw:comment><comments>http://www.blogjava.net/caihualin/articles/164030.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/caihualin/comments/commentRss/164030.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/caihualin/services/trackbacks/164030.html</trackback:ping><description><![CDATA[<div style="margin: 0cm 0cm 0pt 18pt" align="center"><span style="font-size: 18pt; color: #333333">AppFuse</span><span style="font-size: 18pt; color: #333333">快速起步指南</span></div>
<div style="margin: 0cm 0cm 0pt 18pt" align="left"><span style="font-size: 14pt">一、系统环境准备</span></div>
<div style="margin: 0cm 0cm 0pt 57pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">安装</span><span style="font-size: 12pt; color: #333333"> J2SE 1.4.2+ </span><span style="font-size: 12pt; color: #333333">并设置环境变量</span><span style="font-size: 12pt; color: #333333">JAVA_HOME</span><span style="font-size: 12pt; color: #333333">指向</span><span style="font-size: 12pt; color: #333333">J2SE</span><span style="font-size: 12pt; color: #333333">所在的目录。</span></div>
<div style="margin: 0cm 0cm 0pt 57pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333"><a href="https://appfuse.dev.java.net/servlets/ProjectDocumentList"><strong><span><font color="#ff0000">下载</font></span></strong></a> </span><span style="font-size: 12pt; color: #333333">源程序报或者从</span><span style="font-size: 12pt; color: #333333">CVS(cvs -d :pserver:guest@cvs.dev.java.net:/cvs co appfuse)</span><span style="font-size: 12pt; color: #333333">中检出</span><em><span style="font-size: 12pt; color: #333333">appfuse</span></em><span style="font-size: 12pt; color: #333333">模块。</span></div>
<div style="background: #ccffcc; margin: 0cm 0cm 0pt 44.35pt" align="left"><strong><span style="font-size: 9pt; color: #333333">注意</span></strong><strong><span style="font-size: 9pt; color: #333333">:</span></strong><strong><span style="font-size: 9pt; color: #333333">我这里下载的是</span></strong><span style="font-size: 9pt; color: #333333">AppFuse 1.9</span></div>
<div style="margin: 0cm 0cm 0pt 57pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">3.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">安装</span><span style="font-size: 12pt; color: #333333"> Install Ant 1.6.5+ </span><span style="font-size: 12pt; color: #333333">并设置</span><span style="font-size: 12pt; color: #333333"> ANT_HOME </span><span style="font-size: 12pt; color: #333333">环境变量。</span><span style="font-size: 12pt; color: #333333">安装</span><span style="font-size: 12pt; color: #333333"> Tomcat 5.0.28 </span><span style="font-size: 12pt; color: #333333">并设置</span><span style="font-size: 12pt; color: #333333"> CATALINA_HOME </span><span style="font-size: 12pt; color: #333333">环境变量指向对应的</span><span style="font-size: 12pt; color: #333333">Tomcat</span><span style="font-size: 12pt; color: #333333">安装目录。</span></div>
<div style="margin: 0cm 0cm 0pt 57pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">4.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">安装</span><span style="font-size: 12pt; color: #333333"> OracleXE </span></div>
<div style="margin: 0cm 0cm 0pt 18pt" align="left"><span style="font-size: 14pt">二、类的设置</span></div>
<div style="margin: 0cm 0cm 0pt 63pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">把文件</span><span style="font-size: 12pt; color: #333333"> lib/junit3.8.1/junit.jar </span><span style="font-size: 12pt; color: #333333">拷贝到</span><span style="font-size: 12pt; color: #333333"> $ANT_HOME/lib</span><span style="font-size: 12pt; color: #333333">目录下。</span></div>
<div style="background: #ccffcc; margin: 0cm 0cm 0pt 44.35pt" align="left"><strong><span style="font-size: 9pt; color: #333333">注意</span></strong><strong><span style="font-size: 9pt; color: #333333">:</span></strong><span style="font-size: 9pt; color: #333333">你可能会发现在</span><span style="font-size: 9pt; color: #333333"> $ANT_HOME/lib</span><span style="font-size: 9pt; color: #333333">目录已经有一个</span><span style="font-size: 9pt; color: #333333"> ant-junit.jar </span><span style="font-size: 9pt; color: #333333">文件了</span><span style="font-size: 9pt; color: #333333">. </span><span style="font-size: 9pt; color: #333333">这个</span><span style="font-size: 9pt; color: #333333"> jar </span><span style="font-size: 9pt; color: #333333">包不是</span><span style="font-size: 9pt; color: #333333"> JUnit </span><span style="font-size: 9pt; color: #333333">类库</span><span style="font-size: 9pt; color: #333333">, </span><span style="font-size: 9pt; color: #333333">而是</span><span style="font-size: 9pt; color: #333333"> Ant </span><span style="font-size: 9pt; color: #333333">的</span><span style="font-size: 9pt; color: #333333"> junit task </span><span style="font-size: 9pt; color: #333333">实现，在执行</span><span style="font-size: 9pt; color: #333333">Ant junit task</span><span style="font-size: 9pt; color: #333333">时会使用你新增的这个</span><span style="font-size: 9pt; color: #333333">junit.jar </span><span style="font-size: 9pt; color: #333333">文件。</span></div>
<div style="margin: 0cm 0cm 0pt 63pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">在你的</span><span style="font-size: 12pt; color: #333333">{AppFuse home}/lib </span><span style="font-size: 12pt; color: #333333">路径</span><span style="font-size: 12pt; color: #333333">, </span><span style="font-size: 12pt; color: #333333">添加一个</span><span style="font-size: 12pt; color: #333333"> "oracle" </span><span style="font-size: 12pt; color: #333333">目录并且把</span><span style="font-size: 12pt; color: #333333">ojdbc14_g.jar</span><span style="font-size: 12pt; color: #333333">放在里面</span></div>
<div style="margin: 0cm 0cm 0pt 18pt" align="left"><span style="font-size: 14pt">三、开始安装配置</span><span style="font-size: 14pt">Appfuse</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">将下载的</span><span style="font-size: 12pt">AppFuse1.9,</span><span style="font-size: 12pt">解压到一目录</span><span style="font-size: 12pt">appfuse</span><span style="font-size: 12pt">。</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">创建一个用户</span></div>
<div style="border-right: #999999 1pt solid; padding-right: 4pt; border-top: #999999 1pt solid; padding-left: 5pt; background: #ffffdd; padding-bottom: 4pt; border-left: #999999 1pt solid; padding-top: 4pt; border-bottom: #999999 1pt solid">
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">CREATE USER caihualin IDENTIFIED BY welcome;&nbsp;</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">GRANT CONNECT TO caihualin;</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">GRANT RESOURCE TO caihualin;</span></div>
</div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">3.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">修改</span><span style="font-size: 12pt; color: #333333">build.properties </span><span style="font-size: 12pt; color: #333333">文件</span><span style="font-size: 12pt; color: #333333">(</span><span style="font-size: 12pt; color: #333333">在根目录下</span><span style="font-size: 12pt; color: #333333">)</span></div>
<div style="border-right: #999999 1pt solid; padding-right: 4pt; border-top: #999999 1pt solid; padding-left: 1pt; background: #ffffdd; padding-bottom: 4pt; border-left: #999999 1pt solid; padding-top: 4pt; border-bottom: #999999 1pt solid">
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.jar=${lib.dir}/oracle/ojdbc14_g.jar</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.type=oracle</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.host=localhost</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">#use the database schema owner and password created in step #1 above here</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.username=caihualin</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.password=welcome</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left">&nbsp;</div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">hibernate.dialect=org.hibernate.dialect.Oracle9Dialect</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.driver_class=oracle.jdbc.driver.OracleDriver</span></div>
<div style="border-right: medium none; padding-right: 0cm; border-top: medium none; padding-left: 0cm; background: #ffffdd; padding-bottom: 0cm; border-left: medium none; padding-top: 0cm; border-bottom: medium none; text-align: left" align="left"><span style="font-size: 9pt; color: black">database.url=jdbc:oracle:thin:@localhost:1521:XE</span></div>
</div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">4.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">在</span><span style="font-size: 12pt; color: #333333">appfuse</span><span style="font-size: 12pt; color: #333333">目录下运行</span><span style="font-size: 12pt; color: #333333"> <strong>ant new</strong> </span><span style="font-size: 12pt; color: #333333">。会提示你输入</span><span style="font-size: 12pt; color: #333333">application name, database name </span><span style="font-size: 12pt; color: #333333">和</span><span style="font-size: 12pt; color: #333333"> package name</span><span style="font-size: 12pt; color: #333333">。完成这些操作以后会在</span><span style="font-size: 12pt; color: #333333">appfuse</span><span style="font-size: 12pt; color: #333333">同级目录家里一个包含新程序所需要的全部文件的以你输入的</span><span style="font-size: 12pt; color: #333333">application name</span><span style="font-size: 12pt; color: #333333">命名的目录。</span><span style="font-size: 12pt; color: #333333">在这里我运行的是如下命令：</span><strong><span style="font-size: 9pt; color: #333333">ant new -Dapp.name=</span></strong><strong><span style="font-size: 9pt; color: #333333">e-ruite</span></strong><strong><span style="font-size: 9pt; color: #333333"> -Ddb.name=caihualin</span></strong></div>
<div style="background: #ffcccc; margin: 0cm 0cm 0pt 44.35pt" align="left"><strong><span style="font-size: 9pt; color: #333333">警告</span></strong><strong><span style="font-size: 9pt; color: #333333">:</span></strong><span style="font-size: 9pt; color: #333333">请不要在输入的</span><span style="font-size: 9pt; color: #333333">application name, database name </span><span style="font-size: 9pt; color: #333333">和</span><span style="font-size: 9pt; color: #333333"> package name</span><span style="font-size: 9pt; color: #333333">使用</span><span style="font-size: 9pt; color: #333333"> "test", </span><span style="font-size: 9pt; color: #333333">包含</span><span style="font-size: 9pt; color: #333333"> "appfuse" </span><span style="font-size: 9pt; color: #333333">的名称</span><span style="font-size: 9pt; color: #333333">或者</span><span style="font-size: 9pt; color: #333333">以数字作为起始字符的名称，否则将会导致任务无法正常执行，此外使用两个破折号</span><span style="font-size: 9pt; color: #333333"> (-) </span><span style="font-size: 9pt; color: #333333">会造成结果混乱。</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">5.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">切换到这个新的工程目录并且运行</span><span style="font-size: 12pt; color: #333333"> <strong>ant setup</strong> (</span><span style="font-size: 12pt; color: #333333">或者运行</span><span style="font-size: 12pt; color: #333333"> <strong>ant setup-db setup-tomcat deploy</strong>) </span><span style="font-size: 12pt; color: #333333">创建数据库，配置</span><span style="font-size: 12pt; color: #333333">tomcat</span><span style="font-size: 12pt; color: #333333">并发布你的新应用程序。</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">6.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">若你细想要进行测试以确定所有程序工作良好，运行</span><span style="font-size: 12pt; color: #333333"> <strong>ant test-all</strong> - </span><span style="font-size: 12pt; color: #333333">在运行这个任务的时候确定</span><span style="font-size: 12pt; color: #333333"> Tomcat </span><span style="font-size: 12pt; color: #333333">没有启动。</span><span style="font-size: 12pt; color: #333333">接下来</span><span style="font-size: 12pt; color: #333333">, </span><span style="font-size: 12pt; color: #333333">运行</span><span style="font-size: 12pt; color: #333333"> <strong>ant test-reports</strong> - </span><span style="font-size: 12pt; color: #333333">运行结束后会显示消息告诉你如何查看产生的报告。</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -21pt; text-align: left" align="left"><span style="font-size: 12pt; color: #333333">7.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; color: #333333">启动</span><span style="font-size: 12pt; color: #333333">tomcat, </span><span style="font-size: 12pt; color: #333333">运行</span><span style="font-size: 12pt; color: #333333"><a href="http://localhost:8888/e-ruite">http://localhost:8888/e-ruite</a></span></div>
<div style="text-indent: 14pt"><span style="font-size: 14pt">四、导入到</span><span style="font-size: 14pt">Eclipse</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 34.45pt; word-break: break-all; line-height: 20.1pt"><span style="font-size: 12pt">1</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">打开</span><span style="font-size: 12pt">Eclipse</span><span style="font-size: 12pt">，选择文件</span><span style="font-size: 12pt">(File)—</span><span style="font-size: 12pt">导入</span><span style="font-size: 12pt">(import)</span><span style="font-size: 12pt">，出现的页面里选择</span><span style="font-size: 12pt">Exist Project into WorkSpace</span><span style="font-size: 12pt">，选择e-ruite</span><span style="font-size: 12pt">目录，单击确定，则项目导入。</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 39.9pt; word-break: break-all; text-indent: -8.4pt; line-height: 20.1pt"><span style="font-size: 12pt">2</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">选择</span><span style="font-size: 12pt">window—preference</span><span style="font-size: 12pt">，在出现的页面里，选择</span><span style="font-size: 12pt">ant---runtime—Ant Home Entries,</span><span style="font-size: 12pt">单击右边的</span><span style="font-size: 12pt">add external jar</span><span style="font-size: 12pt">，选择</span><span style="font-size: 12pt">junit</span><span style="font-size: 12pt">的</span><span style="font-size: 12pt">jar</span><span style="font-size: 12pt">包，单击确定。</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 39.9pt; word-break: break-all; text-indent: -8.4pt; line-height: 20.1pt"><span style="font-size: 12pt">3</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">属性设置页面，选择J</span><span style="font-size: 12pt">ava Build Path—Libraries--Add Class Folder--Create New Folder,(foldername:JAVA_HOME,checked "link to folder in the file system",</span><span style="font-size: 12pt">选择</span><span style="font-size: 12pt">jdk</span><span style="font-size: 12pt">所在目录即可</span><span style="font-size: 12pt">)</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 38.95pt; word-break: break-all; text-indent: -6pt; line-height: 20.1pt"><span style="font-size: 12pt">4</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">打开项目目录下的</span><span style="font-size: 12pt">build.xml</span><span style="font-size: 12pt">文件，右击</span><span style="font-size: 12pt">--ant build--Targets</span><span style="font-size: 12pt">窗口可以看到很多的任务，选择</span><span style="font-size: 12pt">setup</span><span style="font-size: 12pt">运行并发布项目</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 39pt; word-break: break-all; text-indent: -12pt; line-height: 20.1pt"><span style="font-size: 12pt">5</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">运行</span><span style="font-size: 12pt">ant</span><span style="font-size: 12pt">任务列表中的</span><span style="font-size: 12pt">start.tomcat</span><span style="font-size: 12pt">，会在</span><span style="font-size: 12pt">eclipse</span><span style="font-size: 12pt">的</span><span style="font-size: 12pt">console</span><span style="font-size: 12pt">运行</span><span style="font-size: 12pt">tomcat</span><span style="font-size: 12pt">。</span></div>
<div style="background: white; margin: 0cm 0cm 0pt 39pt; word-break: break-all; text-indent: -12pt; line-height: 20.1pt"><span style="font-size: 12pt">6</span><span style="font-size: 12pt">、</span><span style="font-size: 12pt">&nbsp; </span><span style="font-size: 12pt">打开浏览器，输入</span><span style="font-size: 12pt"><a href="http://localhost:8080/e-ruite"><strong><font color="#ff0000">http://localhost:8888/e-ruite</font></strong></a></span><span style="font-size: 12pt">，会看到登录页面</span></div>
  <img src ="http://www.blogjava.net/caihualin/aggbug/164030.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/caihualin/" target="_blank">蔡华林</a> 2007-11-29 16:39 <a href="http://www.blogjava.net/caihualin/articles/164030.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>