Broadleaf CommunityStarter
这个 Maven 项目是一个社区 Broadleaf Commerce 应用的 Spring Boot 实现。它设置了许多合理的默认值,并举例说明了一个基于 Broadleaf 的全功能电子商务网站是如何工作的。
项目概述
社区演示由 4 个独立项目组成。
~/CommunityDemo » tree -L 1 ├── LICENSE ├── README.md ├── admin ├── api ├── core ├── pom.xml └── site
- admin -- 为 Broadleaf 管理员提供的 Spring Boot 应用程序,用于目录管理,查看已完成的订单等。
- api -- 一个设置 Broadleaf API 端点的 Spring Boot 应用程序。
- site -- 一个 Spring Boot 应用程序,它运行着以 Thymeleaf 作为传统 MVC 构建的 Heat Clinic UI。
- core -- 一个所有其他项目都依赖的通用 jar,用来实现像域名这样的通用功能。
运行项目
你必须先从根目录下做一个 mvn 包或 mvn 安装来构建所有的项目。
~/CommunityDemo " mvn clean install
完成后,你可以使用 mvn spring-boot:run 的 Spring Boot Maven 插件来运行站点、api 或管理员。例子:Spring Boot Maven 插件
~/CommunityDemo » cd site ~/CommunityDemo/site » mvn spring-boot:run Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Community Demo Site 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) > test-compile @ boot-community-demo-site >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ boot-community-demo-site --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] Copying 128 resources [INFO] [INFO] --- jrebel-maven-plugin:1.1.7:generate (generate-rebel-xml) @ boot-community-demo-site --- [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ boot-community-demo-site --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-dependency-plugin:2.10:copy (copy-agent) @ boot-community-demo-site --- [INFO] Configured Artifact: org.springframework:spring-instrument:4.3.9.RELEASE:jar [INFO] org.springframework:spring-instrument:4.3.9.RELEASE:jar already exists in /Users/phillip/broadleaf/5.2/CommunityDemo/site/target/agents [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ boot-community-demo-site --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/phillip/broadleaf/5.2/CommunityDemo/site/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ boot-community-demo-site --- [INFO] No sources to compile [INFO] [INFO] <<< spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) < test-compile @ boot-community-demo-site <<< [INFO] [INFO] [INFO] --- spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) @ boot-community-demo-site --- [INFO] Attaching agents: [/Users/phillip/broadleaf/5.2/CommunityDemo/site/target/agents/spring-instrument.jar] objc[3168]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/bin/java (0x10c6444c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10c7574e0). One of the two will be used. Which one is undefined. Listening for transport dt_socket at address: 8000 ,, ,, ,, ,... *MM `7MM `7MM .d' "" MM MM MM dM` MM,dMMb.`7Mb,od8 ,pW"Wq. ,6"Yb. ,M""bMM MM .gP"Ya ,6"Yb. mMMmm MM `Mb MM' "'6W' `Wb 8) MM ,AP MM MM ,M' Yb 8) MM MM MM M8 MM 8M M8 ,pm9MM 8MI MM MM 8M"""""" ,pm9MM MM MM. ,M9 MM YA. ,A9 8M MM `Mb MM MM YM. , 8M MM MM P^YbmdP'.JMML. `Ybmd9' `Moo9^Yo.`Wbmd"MML..JMML.`Mbmmd' `Moo9^Yo..JMML. --------------------------------------------------- C O M M E R C E ------ 2017-07-10 07:46:28.786 INFO 3168 --- [ main] com.community.SiteApplication : Starting SiteApplication on macbook.local with PID 3168 (/Users/osxuser/CommunityDemo/site/target/classes started by osxuser in /Users/osxuser/broadleaf/5.2/CommunityDemo/site) 2017-07-10 07:46:28.790 INFO 3168 --- [ main] com.community.SiteApplication : No active profile set, falling back to default profiles: default ... ... 2017-07-10 07:49:13.052 INFO 3212 --- [eduler_Worker-1] o.h.cache.internal.StandardQueryCache : HHH000248: Starting query cache at region: query.Search 2017-07-10 07:49:13.181 INFO 3212 --- [ main] c.c.c.s.s.SolrIndexCleanupServiceImpl : Not rebuilding indexes because value was update 2017-07-10 07:49:13.479 INFO 3212 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8443 (https) 8080 (http) 2017-07-10 07:49:13.493 INFO 3212 --- [ main] com.community.SiteApplication : Started SiteApplication in 32.617 seconds (JVM running for 33.017)
如果你有一个 JRebel 许可证,你可以使用 jrebel 配置文件来启动 Jrebel 代理,使用 jrebel.agent.args 属性。OSX 上的例子:
mvn spring-boot:run -Pjrebel -Djrebel.agent.args='-agentpath:/full/path/to/jrebel/lib/libjrebel64.dylib'
我们建议将 jrebel.agent.args 属性移到你的全局 ~/.m2/settings.xml 文件中,这样你就可以直接用以下方法启动应用程序。
mvn spring-boot:run -Pjrebel
有关为您的操作系统使用哪种代理的更多信息,请查阅 Jrebel 文档。
活动端口
每个项目默认启动时都有不同的远程调试端口和 HTTP/HTTPS 连接器端口。
site
- base url: https://localhost:8081
- http -
8080
- https -
8081
- 远程调试端口 -
8000
admin
- base url: https://localhost:8083/admin
- http -
8082
- https -
8083
-
8001
api
- base url: https://localhost:8085/api
- http -
8084
- https -
8085
- 远程调试端口 -
8002
许可证
Broadleaf Commerce Demo Site 本身是根据 Broadleaf 公平使用许可协议 -- 1.0版本(http://license.broadleafcommerce.org/fair_use_lice... Commerce 的核心库和模块库有不同的许可模式,您应该注意。
Broadleaf Commerce 的核心库以及菜单库是以双重许可的形式发布的。它们可以在公平使用许可1.0 (http://license.broadleafcommerce.org/fair_use_lice... Commerce共同商定的许可来代替。
各种可用的商业模块(例如,价格表管理)也在适用的商业许可下发布。这些模块不包含在 Broadleaf 核心框架中。