<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Appfuse 2.0簡單開始和源碼的下載

    Posted on 2007-07-31 17:09 風清云淡 閱讀(494) 評論(0)  編輯  收藏 所屬分類: Java
    前些天花了很久才把appfuse2.0的demo運行出來
    都怪自己maven不熟悉啊

    下載appfuse2.0源碼有兩種方法

    一種是找到他的cvs下載。

    還有一種就是用maven下載,就是appfuse2.0官網上介紹的下載方法。

    好了,現在我們開始下載appfuse2.0的源碼,用第二鐘方法:

    1、下載安裝 JDK5 或以上版本。

    2、下載安裝 Mysql5.x 。 

    3、建立一個本地的 stmp服務器,或者修改 mail.properties(在 src/main/resources 目錄下),使之使用另外一個不同的主機名,它默認是使用的主機名是 "localhost"。(這一步如果不是急需可以先省略,等對appfuse2.0熟悉些了再配置)

    4、下載并安裝Maven 2.0.6 。這個是必須的。有人問說不下載這個行不行?,我們build時用ant。在appfuse2.0中ant已經不推薦使用了,所以這個是必需的。
                       簡單介紹一下maven的使用,在網址http://maven.apache.org/download.html下載maven。

    在Windows 2000/XP中使用

    1. 解壓 maven-2.0.6-bin.zip到你希望安裝Maven 2.0.6的目錄下. 例如 C:\Program Files\Apache Software Foundation\maven-2.0.6
    2. 在你的環境變量path中設置maven的路徑,  在我的電腦上右鍵選屬性, 選擇 "高級" tab, 在 "環境變量" ,新建一個MAVEN_HOME  例如C:\Program Files\Apache Software Foundation\maven-2.0.6。在path中設置%MAVEN_HOME%bin; 。也可以直接在path設置. "C:\Program Files\Apache Software Foundation\maven-2.0.6\bin";%PATH%
    3. 在你的環境變量中, 確認 JAVA_HOME 設置的是你本頂的 JDK, 例如 C:\Program Files\Java\jdk1.5.0_02
    4. 打開:開始--運行--敲入cmd。在命令行 執行mvn --version ,如能正確顯示maven的版本號,說明maven安裝成功。

    如果你不喜歡用命令行的話,你也可以在eclipse創建自己的工程,你可以檢出 Candy for AppFuse

    下面我們就可以下載appfuse2.0了,選擇你熟悉mvc,我下載的是Struts 2 Basic,

    我在D:創建一個文件夾appfuse2-hzy,

    例如D:\appfuse2-hzy\

    命令行中輸入 mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject

    這時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檢測到就不用下載了。

    下面是各種配置類型maven所使用的命令:

    配置類型
    命  令
    JSF Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Spring MVC Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Struts 2 Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Tapestry Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    JSF Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Spring MVC Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Struts 2 Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Tapestry Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
    Core
    (僅后端)
    mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-core -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject

    在maven執行mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject 時,如果你的mysql數據庫已經啟動了,同時root用戶的密碼為空的話,appfuse會自動在你的數據庫中生成一個myproject的數據庫,
    你的root用戶如果有密碼的話,你可以在你創建的項目的文件下的pom.xml中設置一下   <!-- Database settings -->
      root
            添加密碼

    要運行 AppFuse 現在已經很容易了,一旦建立了項目原型,Maven會用hibernate3和dbunit的插件創建和生成數據庫。現在你要做的就是用 Maven 運行 Jetty,然后查看你的工程。

    1、 在命令行下,cd 到你的工程目錄下,運行 mvn integration-test ,這個命令會完成相關 jar 包和 Tomcat 的下載,運行你的工程的集成測試。上面的命令大概需要5-10分鐘。

    2、在你的工程目錄下運行 mvn jetty:run-war ,你就可以去查看你的工程了。Maven 會啟動 Jetty,這樣的話,你就可以用這個地址: http://localhost:8080在你的瀏覽器中查看你的工程了。(如果你使用的是模塊化原型,你需要在你的工程的 web 目錄下運行 mvn jetty:run-war 。)
    管理員的默認用戶名/密碼為 admin/admin ,普通用戶的話,可以用 user/user 登錄。
    運行成功之后,你可能會打開appfuse的src查看源碼
    發現src\main\java\com\hzy\app只有一個App.java再也沒別的文件了,不要著急。我們接著執行如下命令mvn appfuse:full-source.現在你終于可以看到appfuse2.0的源碼了,哈哈.在項目的src\main\java\下會多出一個 org的文件,一步步進去
    你會源碼就在這里。更多詳細細節請去官網扣英文字眼

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    posts - 1, comments - 0, trackbacks - 0, articles - 3

    Copyright © 風清云淡

    主站蜘蛛池模板: 国产成人亚洲精品青草天美| 中文字幕亚洲综合小综合在线| 久久精品国产免费| 自怕偷自怕亚洲精品| 成人永久福利免费观看| 亚洲免费人成在线视频观看| 亚洲综合色7777情网站777| 亚洲片一区二区三区| 成人免费黄色网址| 人人爽人人爽人人片av免费 | 精品国产香蕉伊思人在线在线亚洲一区二区 | 曰批全过程免费视频播放网站 | 中文字幕无码免费久久| 亚洲色丰满少妇高潮18p| 亚洲精品成人片在线播放| 美女被免费视频网站a国产| 久久亚洲免费视频| 免费人成视频在线播放| 亚洲影视自拍揄拍愉拍| 亚洲精品无码久久一线| 国产午夜无码视频免费网站| 91精品免费久久久久久久久| 一区二区三区免费在线观看| 日本亚洲色大成网站www久久| 久久国产亚洲精品麻豆| 婷婷亚洲天堂影院| 毛片a级毛片免费观看免下载| 免费人成毛片动漫在线播放| 成人午夜免费视频| 亚洲AV无码资源在线观看| 亚洲精品视频在线免费| 久久精品国产亚洲一区二区| 四虎永久免费网站免费观看| 国产精品成人免费视频网站京东| 免费精品一区二区三区第35 | 亚洲国产精品狼友中文久久久| 好先生在线观看免费播放| 91福利视频免费观看| 久久久久久AV无码免费网站| 国产成人精品免费大全| 深夜免费在线视频|