我遇到了同样的问题并创建了一个 ant build 回调来自动安装插件列表。
将以下行添加到要安装插件的扩展的 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" />
您需要将所有出现的EXTENSION_NAME替换为您的扩展名的真实名称。您还需要在扩展EXTENSION_NAME.requiredAddons的 project.properties 中添加一个新属性,其中包含您希望安装的插件的逗号分隔列表。
使用此宏,插件将在每次构建时重新安装,这应该没问题。我个人不建议您提交安装它们的文件 - 而是提交插件本身并将其安装在每个构建中。
希望这对你有用。