本人系统环境
os x 10.9 、jdk1.6、mysql5.5
1、在官方网站上下载ofbiz 版本12.02
下载地址 http://www.apache.org/dyn/closer.cgi/ofbiz/apache-ofbiz-12.04.02.zip
2、对下载文件进行解压
进入到 ~/apache-ofbiz/framework/entity/config 目录下打开 entityengine.xml
修改数据库信息:
使用mysql数据库
<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
<!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->
<group-map group-name="org.ofbiz" datasource-name="localmysql"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
<!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> -->
</delegator>
<delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false">
<!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->
<group-map group-name="org.ofbiz" datasource-name="localmysql"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
<!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> -->
</delegator>
<!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant run-install" before running "ant run-tests" -->
<delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
<!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->
<group-map group-name="org.ofbiz" datasource-name="localmysql"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
<!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> -->
</delegator>
修改数据源信息:
<datasource name="localmysql"
helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
field-type-name="mysql"
check-on-start="true"
add-missing-on-start="true"
check-pks-on-start="false"
use-foreign-keys="true"
join-style="ansi-no-parenthesis"
alias-view-columns="false"
drop-fk-use-foreign-key-keyword="true"
table-type="InnoDB"
character-set="utf8"
collate="utf8_general_ci">
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
<inline-jdbc
jdbc-driver="com.mysql.jdbc.Driver"
jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
jdbc-username="ofbiz"
jdbc-password="ofbiz"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-maxsize="25"
time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL
and had to set it to -1 in order to avoid this issue.
For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html-->
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
</datasource>
修改数据库编码:
character-set="utf8"
collate="utf8_general_ci"
localmysqlolap和localmysqltenant 修改和 localmysql修改内容相同
在mysql中创建三个Database,创建的名字分别为:ofbiz、ofbizolap、ofbiztenant
由于本人在配置数据源时,使用默认的用户名和密码(ofbiz),所以在mysql新建用户ofbiz(密码也为ofbiz),并赋所有权限。
3、添加mysql-connector-java-5.1.24-bin.jar包
将mysql-connector-java-5.1.24-bin.jar文件复制到~/apache-ofbiz/framework/entity/lib/jdbc 目录下
4、到ofbiz根目录
安装命令
~$ ant load-demo
本人安装话费了31分钟
启动
$ ant start
打开游览器 输入 http://127.0.0.1:8080/ecommerce/
对Ofbiz进行简单的安装完毕,后来到数据库查看了一下表总共有849张~
来源:oschina
链接:https://my.oschina.net/u/96568/blog/202821