1. 程式人生 > >gradle ofbiz 16 開發環境搭建

gradle ofbiz 16 開發環境搭建

box line eas int data- .org ews statistic family

gradle ofbiz 16 開發環境搭建
2017年02月13日 10:59:19 閱讀數:2702

1.安裝jdk

2.配置jdk環境變量

3.eclipse 安裝svn 插件

4.svn下載Apache OFBiz 16.11.01 源碼

5.下載gradle3.3 插件 存放目錄C:\Users\Administrator\.gradle\wrapper\dists

6.配置mysql 數據庫所需jar包 修改build.gradle 加入compile ‘mysql:mysql-connector-java:5.1.24‘


7.修改數據庫文件默認配置

[html] view plain copy print?
  1. <delegator name="default" entity-model-reader="main" entity-group-reader="main"
    entity-eca-reader="main" distributed-cache-clear-enabled="false">
  2. <group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
  3. <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
  4. <group-map group-name="org.apache.ofbiz.tenant" datasource-name
    ="localmysqltenant"/>
  5. </delegator>
  6. <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">
  7. <group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
  8. <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
  9. <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmysqltenant"/>
  10. </delegator>
  11. <!-- 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" -->
  12. <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
  13. <group-map group-name="org.apache.ofbiz" datasource-name="localmysql"/>
  14. <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmysqlolap"/>
  15. <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmysqltenant"/>
  16. </delegator>


[html] view plain copy print?
  1. <datasource name="localmysql"
  2. helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
  3. field-type-name="mysql"
  4. check-on-start="true"
  5. add-missing-on-start="true"
  6. check-pks-on-start="false"
  7. use-foreign-keys="true"
  8. join-style="ansi-no-parenthesis"
  9. alias-view-columns="false"
  10. drop-fk-use-foreign-key-keyword="true"
  11. table-type="InnoDB"
  12. character-set="utf8"
  13. collate="utf8_general_ci">
  14. <read-data reader-name="tenant"/>
  15. <read-data reader-name="seed"/>
  16. <read-data reader-name="seed-initial"/>
  17. <read-data reader-name="demo"/>
  18. <read-data reader-name="ext"/>
  19. <read-data reader-name="ext-test"/>
  20. <read-data reader-name="ext-demo"/>
  21. <inline-jdbc
  22. jdbc-driver="com.mysql.jdbc.Driver"
  23. jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?characterEncoding=utf-8&autoReconnect=true"
  24. jdbc-username="root"
  25. jdbc-password="root"
  26. isolation-level="ReadCommitted"
  27. pool-minsize="2"
  28. pool-maxsize="250"
  29. time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL
  30. and had to set it to -1 in order to avoid this issue.
  31. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html-->
  32. <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
  33. </datasource>
  34. <datasource name="localmysqlolap"
  35. helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
  36. field-type-name="mysql"
  37. check-on-start="true"
  38. add-missing-on-start="true"
  39. check-pks-on-start="false"
  40. use-foreign-keys="true"
  41. join-style="ansi-no-parenthesis"
  42. alias-view-columns="false"
  43. drop-fk-use-foreign-key-keyword="true"
  44. table-type="InnoDB"
  45. character-set="utf8"
  46. collate="utf8_general_ci">
  47. <read-data reader-name="tenant"/>
  48. <read-data reader-name="seed"/>
  49. <read-data reader-name="seed-initial"/>
  50. <read-data reader-name="demo"/>
  51. <read-data reader-name="ext"/>
  52. <read-data reader-name="ext-test"/>
  53. <read-data reader-name="ext-demo"/>
  54. <inline-jdbc
  55. jdbc-driver="com.mysql.jdbc.Driver"
  56. jdbc-uri="jdbc:mysql://127.0.0.1/ofbizolap?characterEncoding=utf-8&autoReconnect=true"
  57. jdbc-username="root"
  58. jdbc-password="root"
  59. isolation-level="ReadCommitted"
  60. pool-minsize="2"
  61. pool-maxsize="250"
  62. time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL
  63. and had to set it to -1 in order to avoid this issue.
  64. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html-->
  65. <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
  66. </datasource>
  67. <datasource name="localmysqltenant"
  68. helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
  69. field-type-name="mysql"
  70. check-on-start="true"
  71. add-missing-on-start="true"
  72. check-pks-on-start="false"
  73. use-foreign-keys="true"
  74. join-style="ansi-no-parenthesis"
  75. alias-view-columns="false"
  76. drop-fk-use-foreign-key-keyword="true"
  77. table-type="InnoDB"
  78. character-set="utf8"
  79. collate="utf8_general_ci">
  80. <read-data reader-name="tenant"/>
  81. <read-data reader-name="seed"/>
  82. <read-data reader-name="seed-initial"/>
  83. <read-data reader-name="demo"/>
  84. <read-data reader-name="ext"/>
  85. <read-data reader-name="ext-test"/>
  86. <read-data reader-name="ext-demo"/>
  87. <inline-jdbc
  88. jdbc-driver="com.mysql.jdbc.Driver"
  89. jdbc-uri="jdbc:mysql://127.0.0.1/ofbiztenant?characterEncoding=utf-8&autoReconnect=true"
  90. jdbc-username="root"
  91. jdbc-password="root"
  92. isolation-level="ReadCommitted"
  93. pool-minsize="2"
  94. pool-maxsize="250"
  95. time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL
  96. and had to set it to -1 in order to avoid this issue.
  97. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html-->
  98. <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
  99. </datasource>
8.本地數據庫創建MySQL數據庫

[html] view plain copy print?
  1. ofbiz ofbizolap ofbiztenant三個庫
設置編碼格式字符集utf8 -- UTF-8 排序規則Unicode utf8_general_ci


9.命令行gradlew loadDefault 加載默認數據

技術分享圖片

10.命令行 gradlew ofbiz啟動

https://127.0.0.1:8443/ecommerce/control/main 前臺訪問

https://127.0.0.1:8443/accounting/control/setUserPreference 後臺 賬號admin密碼ofbiz

文章標簽: apache ofbiz16 數據庫 mysql jdk

gradle ofbiz 16 開發環境搭建