自动加载安装程序(Hybris 5.1)

自动加载安装程序(Hybris 5.1),hybris,Hybris,我们正在使用插件支持来扩展ycommercewebservices。这是一个既酷又方便的功能,但是我们遇到了一个问题-我们需要在每台机器上执行ant task addoninstall,以将我们的插件依赖项添加到ycommercewebservices模板中: ant addoninstall -Daddonnames="someAddon" -DaddonStorefront.ycommercewebservices="ycommercewebservices" 自动化此过程的最佳方法是什么

我们正在使用插件支持来扩展ycommercewebservices。这是一个既酷又方便的功能,但是我们遇到了一个问题-我们需要在每台机器上执行ant task addoninstall,以将我们的插件依赖项添加到ycommercewebservices模板中:

ant addoninstall -Daddonnames="someAddon" -DaddonStorefront.ycommercewebservices="ycommercewebservices"

自动化此过程的最佳方法是什么?

您不应该每次都使用ycommercewebservices进行构建。这是一个模板扩展,因此以“y”开头

使用extgen从ycommercewebservices生成新扩展。将插件添加到新扩展。将此新扩展提交到您的回购协议。切勿直接触摸模板

因此,永远不应该需要将其自动化


但这只是一项艰巨的任务。自动化有多难?

我遇到了同样的问题,并创建了一个ant构建回调来自动安装插件列表

将以下行添加到要安装插件的扩展的buildcallbacks.xml中的_before_build宏:

<!-- 
    We have included installing the relevant addons as a build callback so that each developer does not need to insatll them manually.
    The Hybris installer script cannot be used as it resets the environment configuration (local.properties) every time it runs.
-->

<echo message="Installing the following addons: ${EXTENSION_NAME.requiredAddons}" />

<var name="addonnames" value="${EXTENSION_NAME.requiredAddons}" />
<var name="storefrontTemplates" value="yacceleratorstorefront" />
<var name="addonStorefront.${storefrontTemplates}" value="EXTENSION_NAME" />

<addoninstall />

<!-- 
    This regex replace removes the additional blank lines that the addoninstall macro adds each time it is called.
    It stops the extensioninfo.xml file continuously growing.
-->
<replaceregexp file="${ext.EXTENSION_NAME.path}/extensioninfo.xml"
    match="\n{3,}"
    replace="${line.separator}${line.separator}"
    flags="g"
    byline="false" />
您需要将所有出现的扩展名替换为扩展名的真实名称。 您还需要向project.properties(扩展扩展名的属性)_NAME.requiredAddons中添加一个新属性,该属性将包含一个逗号分隔的希望安装的插件列表

使用这个宏,插件将重新安装在每个构建上,这应该是好的。我个人不建议您提交安装它们的文件,而是提交插件本身并在每个构建中安装它


希望这对您有用。

插件的目的是将其插入任何标准的hybris商店。
考虑使用Git开发所有的扩展和插件。现在,一旦在任何扩展上安装插件。该扩展名的extensioninfo.xml文件被修改。因此,如果在一台计算机上安装了插件,则可以提交此文件扩展的extensioninfo.xml。它将反映在共享此GIT代码库的每台计算机上。

如果我将插件添加到从模板生成的扩展中,我将不得不在每次迁移到新版本时重新生成扩展。你读过这个吗?我不同意。不应提交插件安装到扩展中的文件。否则,开发人员可能会直接编辑它们,然后被重新安装或升级的加载项覆盖。