本文使用 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"