ofbiz gradle 启动

注:该顺序适应于最新的ofbiz版本和trunk版本,如有不当之处请指出,只作为参考。

1.安装eclipse gradle 插件(  Gradle IDE 3.8.2.201610040550-RELEASE org.springsource.ide.eclipse.gradle.feature.feature.group Pivotal Software, Inc.)
2.下载mysql 并安装启动服务
3.下载ofbiz-trunk 项目(如果网络好的话,可以直接通过eclipse下载,否则请通过svn下载)代码svn地址:http://svn.apache.org/repos/asf/ofbiz/trunk
4.修改项目中build.gradle中以下位置:
把        jcenter() (该位置默认走https访问速度比较慢)
替换为:
        jcenter {
url "http://jcenter.bintray.com"
        }
5. 在build.gradle 文件的dependencies中加入mysql驱动:
compile files('lib/mysql-connector-java-5.1.35-bin.jar')


6.修改entityengine(framework/entity/config/entityengine.xml),将derby数据库修改为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.apache.ofbiz" datasource-name="localderby"/>-->
<group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
<!--<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>-->
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
<!--<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>-->
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmysqltenant"/>
</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.apache.ofbiz" datasource-name="localderby"/>-->
<group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
<!--<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>-->
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
<!--<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>-->
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmysqltenant"/>
    </delegator>


    <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "gradlew loadDefault" before running "gradlew testIntegration" -->
    <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
<!--<group-map group-name="org.apache.ofbiz" datasource-name="localderby"/>-->
<group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
<!--<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>-->
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
<!--<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>-->
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmysqltenant"/>
    </delegator>
7.编译中加入这几个任务:
eclipseClasspath
eclipseProject
loadDefault
8.在build.gradle右键,run打开gradle GUI,在command line 输入ofbiz, 然后execute


注意:如果文件gradle/wrapper/gradle-wrapper.properties 的distributionUrl属性指向下载不下来,可以先下载到本地然后修改指向本地的包。
distributionUrl=/gradle-2.13-bin.zip (这个jar路径和项目一个目录下)


MySQL 5.6 for Windows 解压缩版配置安装
http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html
Gradle体验/第一篇:下装、安装、配置、体验
http://jingyan.baidu.com/article/4d58d541167bc69dd4e9c009.html
 Gradle加载本地jar包
http://blog.csdn.net/m1213642578/article/details/52763130
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值