(1) Setup = Invoked by default if no task is specified with install command. It installs recipe & copies files. (2) Initialize = Initializes the recipes application. (3) Start = Start the application.
https://www.novusedu.com/wp-content/uploads/2017/12/4-Hybris-Install.pdf
在recipe文件夹里看到的build.gradle内容里包含的setup任务:
使用的两个plugin:
- installer-platform-plugin
- installer-addon-plugin
两种声明plugin使用的方式:
apply plugin: 'someplugin1'
apply plugin: 'maven'
and other one:
plugins {
id 'org.hidetake.ssh' version '1.1.2'
}
The plugins block is the newer method of applying plugins, and they must be available in the Gradle plugin repository. The apply approach is the older, yet more flexible method of adding a plugin to your build. The new plugins method does not work in multi-project configurations (subprojects, allprojects), but will work on the build configuration for each child project.
区别在于后者的语法要求声明的plugin必须在gradle plugin repository里可用:
Keep in mind, that applying a plugin using the plugins DSL (plugins {...}) does not work for your private plugins or company plugins which are not published to the official Gradle plugin repo. That's why I hope the old approach will at least survive until the new one does support searching in private repositories.
plugin的定义
Gradle at its core intentionally provides very little for real world automation. All of the useful features, like the ability to compile Java code, are added by plugins. Plugins add new tasks (e.g. JavaCompile), domain objects (e.g. SourceSet), conventions (e.g. Java source is located at src/main/java) as well as extending core objects and objects from other plugins.
给一个Gradle项目应用plugin,可以扩展该project的功能:
(1) Extend the Gradle model (e.g. add new DSL elements that can be configured) (2) Configure the project according to conventions (e.g. add new tasks or configure sensible defaults) (3) Apply specific configuration (e.g. add organizational repositories or enforce standards)
plugin的类型
There are two general types of plugins in Gradle, binary plugins and script plugins - 分为二进制插件和脚本插件两类。
Binary plugins are written either programmatically by implementing Plugin interface or declaratively using one of Gradle’s DSL languages. Binary plugins can reside within a build script, within the project hierarchy or externally in a plugin jar.
Script plugins are additional build scripts that further configure the build and usually implement a declarative approach to manipulating the build. They are typically used within a build although they can be externalized and accessed from a remote location.
https://docs.gradle.org/current/userguide/plugins.html
plugin的解析
Resolving a plugin means finding the correct version of the jar which contains a given plugin and adding it the script classpath. Once a plugin is resolved, its API can be used in a build script.
一旦插件解析成功之后,在build script内可以使用其API.
Script plugins are self-resolving in that they are resolved from the specific file path or URL provided when applying them. - 脚本插件是自动解析的。
Core binary plugins provided as part of the Gradle distribution are automatically resolved. Gradle发行版里自带的核心二进制插件自动被解析。
再回过头来看Hybris recipe文件夹下的build.gradle的三个任务:
setup任务使用了插件installer-platform-plugin的setup方法:
插件installer-platform-plugin的实现位于installer文件夹的libs文件夹下面:
setup实现的源代码:
void setup() {
try {
beforeSetup.each { it() }
copyDriverJarIfNeeded()
storeLocalProperties()
storeLocalExtensions()
setupDone = true
log '>>>>>>>>>> Setting up platform properties/extensions ...... DONE'
} finally {
afterSetup.each { it() }
}
}
关于recipe的更多说明,可以查看文件夹下的readme.txt:
执行完setup之后,bin文件夹的父文件夹内,就会出现很多平级的文件夹:config, data, log, roles和temp.
其中data文件夹存放的是数据库相关的内容:
config文件夹:It has all config files. Instead modifying files in platform folder, modify them in the config folder (localextensions.xml / local.properties). If you are sure what you doing, then you can also do in platform folder.
为什么Hybris第一次启动前需要先build?
(1) Hybris is extendable complex solution. During build, all referenced components are integrated. (2) Runtime files and configuration files are created, prepared, and validated. (3) Some parts of Hybris are compiled, such as: - Service Layer & Other Hybris Components
使用ant和maven进行build:
(1) Compiling Source code into Binary code (2) Generates & compiles Model classes based on definitions in "*-items.xml" file (3) Running tests (4) Deployment to production systems (5) It builds every extension listed (or) referenced by "localextensions.xml"
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关推荐
SAP hybris是SAP公司旗下一款成熟的电子商务解决方案,提供了包括B2C和B2B在内的全面电子商务解决方案。SAP hybris电商实施和开发的案例分享表明,该平台利用了模块化和服务导向架构(SOA),以此来快速响应业务需求...
SAP Hybris是一个高度可扩展的电子商务框架,主要用于构建复杂的多渠道商务解决方案。它由SAP公司开发,旨在帮助企业实现线上和线下的无缝融合,提供个性化的购物体验,并且能够处理大量的交易数据。Hybris框架的...
### SAP Hybris 6.4 B2C 平台搭建详解 #### 一、概述 本文档旨在为SAP Hybris 6.4初学者提供一份详细的B2C平台搭建指南。通过本教程,读者可以了解如何从零开始搭建一个完整的Hybris 6.4 B2C平台,并解决在搭建...
hybris(现为SAP Commerce Cloud)是一个多渠道电子商务软件解决方案,它为商业机构提供了一个灵活的平台,以开展多渠道电子商务和增强型客户服务。根据所提供的文件内容,我们可以从中提取出以下几个知识点: 1. ...
2. **配置Hybris插件**: 在Eclipse的“Preferences”中,找到“SAP Hybris Commerce Platform”设置,配置Hybris安装路径和工作空间。 3. **创建连接**: 在“Servers”视图中,右键选择“New” -> “SAP Hybris ...
SAP Hybris作为客户参与和商务的基础,与SAP ERP Retail、SCM、CRM等模块紧密集成,形成一个强大的全渠道生态系统,包括云销售、营销数据管理、物联网(IoT)工具、社交媒体互动等,为零售商和品牌商提供全方位的...
- **SAP Hybris电子商务平台开发者**:对于已经熟悉或正在学习Hybris平台的开发者来说,掌握Java-SAP Hybris Component是非常重要的一步,这将极大地提升他们在项目中的贡献度和工作效率。 - **对Java编程感兴趣的...
### Java-SAP Hybris Template Builder:高效构建电子商务模板的终极工具 #### 一、引言 随着电子商务行业的快速发展,企业对于高效、灵活且稳定的电子商务平台的需求日益增长。在这个背景下,Java-SAP Hybris ...
由于对当前版本和文档的访问仅限于为 SAP Hybris parterns 工作的人员,因此我无法使该项目保持最新状态。 因此,如果您想维护这个项目,请随时与我联系。hybris-base-image Hybris Commerce Suite 的基本映像,...
SAP hybris电子商务全渠道解决方案介绍 加QQ2823792750 获取
这个压缩包包含了26页的培训材料,旨在帮助IT专业人士深入理解hybris Commerce的开发过程和核心特性。 【描述】描述中的"hybrisCommerceDeveloperTraining1.01Overview共26页.pdf.zip"指出这是一个PDF文档的压缩...
"Hybris帮助文档"这个压缩包可能包含了这些学习资料,包括教程、API参考、最佳实践指南等,对理解并掌握Hybris系统非常有帮助。 总之,Hybris是一个强大且灵活的电子商务平台,其全面的功能和强大的技术特性使其...
本指南将详细解析如何安装与初始化 Hybris Commerce Suite 的过程,并且特别强调了如何在 HSQLDB 和 Hybris Server 上进行配置。这两个技术均已被预先配置并包含在安装包内。 #### 系统需求 在正式开始安装前,了解...
【标题】"hybris Commerce Developer Training" 是一个针对 hybris 平台的电商开发者培训课程。这个课程旨在帮助开发者深入理解 hybris Commerce 的核心概念、架构以及开发流程,以提升他们在电商领域的专业技能。 ...
该扩展将Gmail与SAP Hybris Cloud for Customer解决方案连接起来,在向潜在客户和客户发送电子邮件时提供所有销售信息的快速浏览,并允许您链接电子邮件对话,搜索重复联系人,创建新的潜在客户,任务和访问,全部...
数字创新现已改变我们的生活方式:沟通、购物、支付、学习和工作。同时也改变 了我们追求爱情的方式。如今,由于网上交友提供了更多选择和机会,通过 Tinder 等应用程序找到潜在伴侣的情况并不鲜见。但寻求和发展...
【标题】"hybris入门手册_hybris"涵盖了SAP的hybris平台,这是一个高度可扩展的电子商务解决方案,主要用于构建B2B和B2C在线商店。Hybris平台结合了内容管理、订单处理、产品目录管理、客户服务和市场推广等多种功能...
在IT行业中,SAP Hybris是一个著名的电子商务平台,它提供了高度可扩展的解决方案,用于构建复杂的B2B和B2C在线商店。本教程将详细解释如何使用Vagrant这一轻量级虚拟化工具来安装SAP Hybris。Vagrant允许开发者在...
适用于SAP Commerce Cloud的Worldpay连接器SAP Commerce Cloud的Worldpay连接器是Commerce店面的无缝扩展,使零售商可以通过一次集成以安全,合规和统一的方式实施其全球支付策略。 广泛的WorldPay扩展使零售商能够...