本文使用 hybris 5.7版web
https://wiki.hybris.com/display/accdoc50to56/Creating+AddOnsjsp
1、建立addonui
方案1、this
/hybris/bin/platformrest
执行 ant extgen 命令code
执行以后如出现下面的错误请参考这里(没有请忽略):orm
BUILD FAILED /Code/hybris/bin/platform/build.xml:20: The following error occurred while executing this line: /Code/hybris/bin/platform/resources/ant/antmacros.xml:159: XXXXX.webroot '/rest' is already used by extension 'ycommercewebservices'!
须要去/Code/lining/Code/hybris/bin/ext-template/ycommercewebservices/extensioninfo.xmlxml
<!-- 注释掉下面三段话 从新 ant extgen 命令--> <webmodule jspcompile="false" webroot="/rest"/> <meta key="extgen-template-extension" value="true"/> <meta key="modulegen-name" value="commercewebservices"/>
选择模板get
yaddonwebservice
输入name
testaddon
输入package
com.b2c.testaddon
方案2、
/hybris/bin/platform 执行下面命令
ant -Dinput.template=yaddon -Dinput.name=testaddon -Dinput.package=com.b2c.testaddon
2、使用addon
在localextentions.xml 中添加如下代码:
<extension name="testaddon" />
/hybris/bin/platform
ant addoninstall -Daddonnames="testaddon" -DaddonStorefront.ychinaacceleratorstorefront="chinatrailstorefront"