Hybris 如何防止在编译过程中生成 addonsrc 和 commonwebsrc?

Hybris how to prevent generation of addonsrc and commonwebsrc during compilation?

我们有一个结构,其中有 2 个 modulegen 扩展 testfacades 和 teststorefront。我们还从 ycommercewebservices 生成了 testwebservices 扩展。我们已将 orderselfserviceaddon 安装到 teststorefront。

现在,当我们将 testfacades 依赖项添加到 testwebservices 时,出现以下编译错误:

  [echo] Compile addonsrc testwebservices - orderselfserviceaddon
[yjavac] Compiling 7 source files to C:\carrefour\HybrisFood\hybris\bin\custom\carrefour\testwebservices\web\webroot\WEB-INF\classes
[yjavac] ----------
[yjavac] 1. ERROR in C:\carrefour\HybrisFood\hybris\bin\custom\carrefour\testwebservices\web\addonsrc\orderselfserviceaddon\de\hybris\platform\orderselfserviceaddon\controllers\pages\AccountReturnsPageController.java (at line 16)
[yjavac]     import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn;
[yjavac]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[yjavac] The import de.hybris.platform.acceleratorstorefrontcommons.annotations cannot be resolved

为什么会这样?如何防止此文件夹在构建过程中生成?

因为您将 orderselfserviceaddon 安装到您的 testwebservices 项目中,它会将该插件的所有源代码(在 web 文件夹内)复制到 addonsrc 文件夹中。这就是 hybris 的插件安装过程的工作原理。每 ant clean all 这个文件夹将被覆盖。

您安装的插件 (orderselfserviceaddon) 似乎依赖于另一个插件中的注释。

  • 如果你在测试项目中不需要这个插件,将testwebservices的extensioninfo.xml中的<requires-extension="orderselfserviceaddon"/>去掉插件。

  • 如果您在此处需要此代码,您只需在 extensionsinfo.xml(testwebservices)中添加所需的扩展标记,同时包含此插件中的 acceleratorstorefrontcommons 代码。

<requires-extension name="acceleratorstorefrontcommons"/>