中文字幕av高清在线观看,精品一区二区三区久久久,精品国产不卡http://www.aygfsteel.com/chenlh/category/43260.htmlzh-cnThu, 24 Dec 2009 11:23:19 GMTThu, 24 Dec 2009 11:23:19 GMT6018步啟動appfuse2.0.2http://www.aygfsteel.com/chenlh/articles/307143.htmlchenlhchenlhThu, 24 Dec 2009 05:58:00 GMThttp://www.aygfsteel.com/chenlh/articles/307143.htmlhttp://www.aygfsteel.com/chenlh/comments/307143.htmlhttp://www.aygfsteel.com/chenlh/articles/307143.html#Feedback0http://www.aygfsteel.com/chenlh/comments/commentRss/307143.htmlhttp://www.aygfsteel.com/chenlh/services/trackbacks/307143.html 2、  配置 JAVA_HOME M2_HOME
在path中添加%JAVA_HOME%\bin;%M2_HOME%\bin
3、  將下載下來的appfuse-dependencies-2.0.2解壓到.m2/repository 下面
4 、 創建自己存放項目的目錄 例如 c://appfuse
5、  cd c://appfuse
6、  運行創建骨架的命令,不同的框架選用不同的命令,以下是Struts2 Basic的創建命令
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject
mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.qhin.app -DartifactId=qshin
說明:DartifactId:項目名稱 DgroupId:包結構
運行完以上命令,將會生成c://appfuse/qshin
7、  cd c://appfuse/qshin 運行 mvn
說明:運行到[cargo:start {execution: start-container}] 會比較慢 會下載tomcat6到 C:\Documents and Settings\Johnson Lee\Local Settings\Temp\cargo\installs
發生錯誤
解決方法:在pom.xml文件找到Cargo settings塊 手動下載tomcat壓縮包 替換 C:\Documents and Settings\Johnson Lee\Local Settings\Temp\cargo\installs中的
運行通過
8、  剩下的命令就是運行程序了 mvn jetty:run-war 好了 可以運行 http://localhost:8080了
熟悉清爽的界面出現在眼前
9、  開始構建吧
運行 mvn war:inplace 將war中的文件放入 自己的項目的webapp目錄
運行 mvn appfuse:full-source 出現錯誤 查找了原因 據說是ant 1.7.0的bug 1.7.1會解決 空格的問題
解決方法:配置 maven/cong/setting.xml <localRepository>C:\appfuse\repository</localRepository>
我將原來.m2/repository 下的文件拷貝到了C:\appfuse\repository 使用此處的
重新運行mvn appfuse:full-source 通過 重新看看C:\appfuse\qshin\src\main\java下面吧 將org.appfuse的源文件都copy過來了
并且讓我開心的是 都改名為com.qhin.app了 dao model service util webapp 都在下面了 高興
10、  運行mvn install eclipse:eclipse 生成eclipse的項目文件 當然也可以用idea netbeans
這個過程會慢點 因為要下載一些依賴的jar
11、 導入myeclipse
12 、 創建表
CREATE TABLE `Employee` (
`id` bigint(20) NOT NULL auto_increment,
`code` varchar(10) NOT NULL,
`dept` varchar(50) NOT NULL,
`name` varchar(20) NOT NULL,
`status` varchar(10) NOT NULL,
`telephone` varchar(20) default NULL,
`title` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
13、  由表生成model 運行mvn appfuse:gen-model
會在model包中生成Employee.java
查看原代碼,原來model中有兩個ID的生成策略,如下:
@Id @GeneratedValue(strategy=IDENTITY) @GeneratedValue(strategy = GenerationType.AUTO)
刪除@GeneratedValue(strategy=IDENTITY),只剩下一個。
14、 由model 生成CRUD
mvn appfuse:gen -Dentity=Employee
會生成employeeList.jsp、employeeForm.jsp、EmployeeAction.java
但是沒有自動生成dao與service 而是采用的GenericManager<Employee, Long>中的方法,解決方法見15
15、  在項目下的pom.xml中查找genericCore,大概在940行 找到 將屬性true 改為false
像這樣<amp.genericCore>false</amp.genericCore>
16、  重新運行 mvn appfuse:gen -Dentity=Employee
在myeclipse中查看代碼 dao 與 service也都生成了
17、  運行 mvn jetty:run
在瀏覽器中查看界面吧
18、  但是最后還有個問題 就是appfuse頁面中 顯示亂碼
解決方法:修改pom.xml中
255行:UTF-8
260行: *_zh*.properties
293行:<exclude>*_zh*.properties</exclude>
發現問題依然存在,然后修改display*.properties文件,把里面的文件改成中文,然后mvn jetty:run一下就可以了

轉載自:http://www.pben.cn/main.htm?action=read&bid=33&postID=8a8181871e4825c2011ecb2c9c070e18

            http://www.pben.cn/


chenlh 2009-12-24 13:58 發表評論
]]>
Appfuse: Create new project for eclipsehttp://www.aygfsteel.com/chenlh/articles/307142.htmlchenlhchenlhThu, 24 Dec 2009 05:47:00 GMThttp://www.aygfsteel.com/chenlh/articles/307142.htmlhttp://www.aygfsteel.com/chenlh/comments/307142.htmlhttp://www.aygfsteel.com/chenlh/articles/307142.html#Feedback0http://www.aygfsteel.com/chenlh/comments/commentRss/307142.htmlhttp://www.aygfsteel.com/chenlh/services/trackbacks/307142.html

1、使用時mvn eclipse:eclipse命令出錯時,使用如下命令代替
    mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
    或 直接修改工程目錄下的pom.xml中maven-eclipse-plugin的version由2.7改為2.6
    ...
    <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.6</version>
                <configuration>
    ...
    
    


chenlh 2009-12-24 13:47 發表評論
]]>
主站蜘蛛池模板: 佛学| 辽阳县| 土默特右旗| 嘉禾县| 高密市| 广西| 肇州县| 青岛市| 界首市| 大石桥市| 江西省| 清远市| 崇仁县| 辽阳市| 安平县| 柳州市| 恩平市| 宜兴市| 克什克腾旗| 布尔津县| 荣昌县| 松原市| 左贡县| 绥滨县| 沅陵县| 富平县| 门头沟区| 恩施市| 钦州市| 区。| 大同县| 通化县| 靖江市| 日照市| 永定县| 隆安县| 广德县| 横峰县| 富阳市| 海原县| 隆回县|