下載及部署命令:http://ofbiz.apache.org/download.html
OFBiz的安裝部署是基於ant的,官網的案例是執行load-demo任務和start任務。以下分析是以12.04版本為案例。
OFBiz的ant任務解讀
- ./build.xml
【load-demo】<-【build】<-【ofbiz-init】
【ofbiz-init】設置env變量
【build】
framework/build.xml(框架庫的編譯和打包,既包括sql和server等,也包括start和webtools等)
applications/build.xml(ofbiz各模塊的編譯和打包)
specialpurpose/build.xml(模塊定制和封裝)
hot-deploy下的所有build.xml(目錄為空)
antcall:clean-svninfo
【load-demo】
jar ofbiz.jar install
【start】啟動ofbiz.jar
其他任務簡介(只列出部分比較重要的):
| target |
description |
| refresh |
Clean all and rebuild |
| clean-all |
Clean all DB, Catalina and caches data, logs, and runtime subdirectories and all specific files like .rej, .orig |
| docs-all |
For committers : Build all javadoc into one tree for easier viewing by the community |
| start |
Start OFBiz |
| start-batch |
Start OFBiz as a separate process |
| start-debug |
Start OFBiz in debugging mode |
| stop |
Stop OFBiz |
| status |
Display status of OFBiz |
| load-demo |
Load all data; meant for generic OFBiz development, testing, demonstration, etc purposes |
| load-demo-multitenant |
Load all data needed for the multi-tenancy demonstration. Caution: this creates three databases, with each one loaded with all demo data. |
| load-seed |
Load ONLY the seed data (not seed-initial, demo, ext* or anything else); meant for use after an update of the code to reload the seed data as it is generally maintained along with the code and needs to be in sync for operation |
| load-extseed |
Load seed, seed-initial and ext data; meant for manual/generic testing, development, or going into production with a derived system based on stock OFBiz where the ext data basically replaces the demo data |
| load-readers |
Load data using the command line argument data-readers that takes a comma separated list of readers (seed, seed-initial, demo, ext, ext-test, ext-demo). On Windows XP (at least) you need top wrap the parameters in double-quotes. For instance: ant load-readers "-Ddata-readers=seed,seed-initial,ext" |
| load-file |
Load data using the command line argument 'data-file' to load data from a given file using the 'default' delegator or a delegator specified in the command line argument 'delegator' |
| load-tenant |
Load data using tenantId, syntax eg: ant load-tenant -DtenantId=DEMO1 (needs multitenant=Y in general.properties) |
| load-all-tenants |
Load data for all tenants, syntax eg: ant load-all-tenants (needs multitenant=Y in general.properties) |
| run-tests |
Run a single test suite, syntax eg: ant run-test-suite -Dtest.component=mycomponent -Dtest.suiteName=mytests |
- common.xml
最終命令見macros.xml
- macros.xml
iterate遍歷子目錄執行操作
javac16(依賴default-javac)指定java編譯器
default-javadoc生成javadoc
main-jar打包成運行用的jar包
test-jar打包成測試用的jar包
default-groovyc編譯器
ofbiz-javacc語法編譯器
ofbiz-jjtree語法樹
yuicompressor壓縮js等代碼資源
