﻿<?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-风清云淡-文章分类-Java</title><link>http://www.blogjava.net/surroad/category/6922.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 02 Aug 2007 09:41:47 GMT</lastBuildDate><pubDate>Thu, 02 Aug 2007 09:41:47 GMT</pubDate><ttl>60</ttl><item><title> AppFuse2 建立新project命令</title><link>http://www.blogjava.net/surroad/articles/133621.html</link><dc:creator>风清云淡</dc:creator><author>风清云淡</author><pubDate>Tue, 31 Jul 2007 09:10:00 GMT</pubDate><guid>http://www.blogjava.net/surroad/articles/133621.html</guid><wfw:comment>http://www.blogjava.net/surroad/comments/133621.html</wfw:comment><comments>http://www.blogjava.net/surroad/articles/133621.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/surroad/comments/commentRss/133621.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/surroad/services/trackbacks/133621.html</trackback:ping><description><![CDATA[<table class="confluenceTable">
    <tbody>
        <tr>
            <th class="confluenceTh">Archetype</th><th class="confluenceTh">Command</th>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>JSF Basic</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Spring MVC Basic</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Struts 2 Basic</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Tapestry Basic</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>JSF Modular</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Spring MVC Modular</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Struts 2 Modular</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Tapestry Modular</strong> </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Core</strong> <br clear="all">(backend only) </td>
            <td class="confluenceTd">mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-core -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://www.blogjava.net/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
    </tbody>
</table><img src ="http://www.blogjava.net/surroad/aggbug/133621.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/surroad/" target="_blank">风清云淡</a> 2007-07-31 17:10 <a href="http://www.blogjava.net/surroad/articles/133621.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> Appfuse 2.0简单开始和源码的下载</title><link>http://www.blogjava.net/surroad/articles/133618.html</link><dc:creator>风清云淡</dc:creator><author>风清云淡</author><pubDate>Tue, 31 Jul 2007 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/surroad/articles/133618.html</guid><wfw:comment>http://www.blogjava.net/surroad/comments/133618.html</wfw:comment><comments>http://www.blogjava.net/surroad/articles/133618.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/surroad/comments/commentRss/133618.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/surroad/services/trackbacks/133618.html</trackback:ping><description><![CDATA[前些天花了很久才把appfuse2.0的demo运行出来<br>
都怪自己maven不熟悉啊<br>
<p>下载appfuse2.0源码有两种方法</p>
<p>一种是找到他的cvs下载。</p>
<p>还有一种就是用maven下载，就是appfuse2.0官网上介绍的下载方法。</p>
<p>好了，现在我们开始下载appfuse2.0的源码，用第二钟方法：<br>
</p>
<p>1、<span class="nobr">下载</span>安装 JDK5 或以上版本。</p>
<p>2、<span class="nobr">下载</span>安装 Mysql5.x 。&nbsp;</p>
<p> 3、建立一个本地的 stmp服务器<span class="nobr"></span><span class="nobr"></span>，或者修改 mail.properties(在 src/main/resources 目录下)，使之使用另外一个不同的主机名，它默认是使用的主机名是 "localhost"。（这一步如果不是急需可以先省略，等对appfuse2.0熟悉些了再配置）</p>
4、下载并安装<span class="nobr"></span><span class="nobr"></span>Maven 2.0.6 。这个是必须的。有人问说不下载这个行不行？，我们build时用ant。在appfuse2.0中ant已经不推荐使用了，所以这个是必需的。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 简单介绍一下maven的使用，在网址http://maven.apache.org/download.html下载maven。<br>
<div class="section">
<h4>在Windows 2000/XP中使用</h4>
<ol type="1">
    <li>解压 <tt>maven-2.0.6-bin.zip</tt>到你希望安装Maven 2.0.6的目录下. 例如 <tt>C:\Program Files\Apache Software Foundation\maven-2.0.6</tt></li>
    <li>在你的环境变量path中设置maven的路径,&nbsp; 在我的电脑上右键选属性, 选择 "高级" tab, 在 "环境变量" ,新建一个MAVEN_HOME&nbsp; 例如<tt>C:\Program Files\Apache Software Foundation\maven-2.0.6。在path中设置%</tt>MAVEN_HOME<tt>%bin;</tt> 。也可以直接在path设置. <tt>"C:\Program Files\Apache Software Foundation\maven-2.0.6\bin";%PATH%</tt></li>
    <li>在你的环境变量中, 确认 <tt>JAVA_HOME</tt> 设置的是你本顶的 JDK, 例如 <tt>C:\Program Files\Java\jdk1.5.0_02</tt></li>
    <li>打开：开始--运行--敲入cmd。在命令行 <tt>执行mvn --version</tt> ，如能正确显示maven的版本号，说明maven安装成功。</li>
</ol>
</div>
<p> 如果你不喜欢用命令行的话，你也可以在eclipse创建自己的工程，你可以检出 <span class="nobr"><a  href="http://candy4appfuse.sourceforge.net/" title="Visit page outside confluence" rel="nofollow">Candy for AppFuse<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> 。</p>
<p>下面我们就可以下载appfuse2.0了，选择你熟悉mvc，我下载的是<strong>Struts 2 Basic，</strong></p>
<p>我在D:创建一个文件夹<strong>appfuse2-hzy，</strong></p>
<p>例如D:\appfuse2-hzy\</p>
<p>在<img  src="file:///C:/DOCUME%7E1/abc/LOCALS%7E1/Temp/moz-screenshot.jpg" alt=""><strong>命令行中输入 m</strong>vn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject <br>
</p>
<p>这时maven就开始创建项目了，maven首先在C:\Documents and
Settings\你的计算机用户名\.m2\repository下载appfuse2.0所需要的jar文件，这是一个漫长的等待过程。如果你的网速
极快，你可以等下去。在appfuse.java.net网站中appfuse作者已经给我们准备好appfuse2.0.m5-
dependencies.zip，你只要把它解压到C:\Documents and
Settings\你的计算机用户名\.m2\repository目录里面maven检测到就不用下载了。</p>
<p>下面是各种配置类型maven所使用的命令：<br>
</p>
<table class="confluenceTable">
    <tbody>
        <tr>
            <th class="confluenceTh"> 配置类型 <br clear="all">
            </th>
            <th class="confluenceTh"> 命&nbsp; 令 </th>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>JSF Basic</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Spring MVC Basic</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Struts 2 Basic</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Tapestry Basic</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>JSF Modular</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Spring MVC Modular</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Struts 2 Modular</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Tapestry Modular</strong> </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject </td>
        </tr>
        <tr>
            <td class="confluenceTd"> <strong>Core</strong> <br clear="all">
            (仅后端) </td>
            <td class="confluenceTd"> mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-core -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject</td>
        </tr>
    </tbody>
</table>
<br>
在maven执行mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=<span class="nobr"><a  href="http://static.appfuse.org/repository" title="Visit page outside confluence" rel="nofollow">http://static.appfuse.org/repository<sup><img  src="http://wiki.redsaga.com/confluence/images/icons/linkext7.gif" class="rendericon" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>
-DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app
-DartifactId=myproject
时，如果你的mysql数据库已经启动了，同时root用户的密码为空的话，appfuse会自动在你的数据库中生成一个myproject的数据库，<br>
你的root用户如果有密码的话，你可以在你创建的项目的文件下的pom.xml中设置一下&nbsp;&nbsp; &lt;!-- Database settings --&gt;<br>
&nbsp; <jdbc>root</jdbc><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <jdbc>添加密码</jdbc><br>
<p>要运行 AppFuse 现在已经很容易了，一旦建立了项目原型，Maven会用hibernate3和dbunit的插件创建和生成数据库。现在你要做的就是用 Maven 运行 Jetty,然后查看你的工程。</p>
<p>1、 在命令行下，<strong>cd</strong> 到你的工程目录下，运行 <strong>mvn integration-test</strong> ，这个命令会完成相关 jar 包和 Tomcat 的下载，运行你的工程的集成测试。上面的命令大概需要5-10分钟。</p>
2、在你的工程目录下运行 <strong>mvn jetty:run-war</strong> ,你就可以去查看你的工程了。Maven 会启动 Jetty,这样的话，你就可以用这个地址： <span class="nobr"><a  href="http://localhost:8080/" title="Visit page outside confluence" rel="nofollow">http://localhost:8080</a></span>在你的浏览器中查看你的工程了。（如果你使用的是模块化原型，你需要在你的工程的 web 目录下运行 <strong>mvn jetty:run-war</strong> 。）<br>
管理员的默认用户名/密码为 <strong>admin/admin</strong> ，普通用户的话，可以用 <strong>user/user</strong> 登录。<br>
运行成功之后，你可能会打开appfuse的src查看源码<br>
发现src\main\java\com\hzy\app只有一个App.java再也没别的文件了，不要着急。我们接着执行如下命令mvn
appfuse:full-source.现在你终于可以看到appfuse2.0的源码了，哈哈.在项目的src\main\java\下会多出一个
org的文件，一步步进去<br>
你会源码就在这里。更多详细细节请去官网扣英文字眼<img src ="http://www.blogjava.net/surroad/aggbug/133618.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/surroad/" target="_blank">风清云淡</a> 2007-07-31 17:09 <a href="http://www.blogjava.net/surroad/articles/133618.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>