cancel
Showing results for 
Search instead for 
Did you mean: 

wro_addons.xml and classpath in SAP Commerce Cloud

phoude
Participant
0 Kudos

Hi,

I have a wro.xml file which includes the wro_addons.xml with this directive:

<import>classpath:wro_addons.xml</import>

I have <group> defined in the wro_addons.xml for js files which works well locally. However it does not work when deploying to SAP Cloud. An HTTP 404 is returned as if WRO was not able to import the wro_addons.xml via classpath. What am I missing? Using sap commerce 2105

Accepted Solutions (0)

Answers (1)

Answers (1)

mansurarisoy
Contributor
0 Kudos

wro_addons.xml is generated during build process. Check the yacceleratorstorefront's buildcallback.xml to understand how it is generated. Possibly you'll have your own customstorefront extension.

In builcallback.xml, the following is the definition of the xml file path.

<property name="yacceleratorstorefront.wro.addons.dest.path" value="${ext.yacceleratorstorefront.path}/resources/wro_addons.xml" />

And the following macrodef declarations are responsible for the generation of the file.

yacceleratorstorefront_delete_wro_addons_xml
yacceleratorstorefront_create_empty_wro_addons_xml
yacceleratorstorefront_generate_wro_addons_xml
yacceleratorstorefront_create_wro_addons_xml
yacceleratorstorefront_fix_root_node_for_wro_addons_xml

You have following options to achieve what you need.

  • Change directly wro.xml file to add what you need
  • Modify buildcallback.xml so that wro_addons.xml is generated according to your needs
  • Create a new xml file to include in wro.xml (this can also be done in buildcallback.xml if you have dynamically generated values)

Hope this helps,

phoude
Participant
0 Kudos

My issue does not relate to the generation of the addons xml but the fact that the JS cannot loaded in Commerce Cloud but works locally. The classpath import from wro.xml does not seem to work so anything defined in the wro_addons.xml is not loaded.

mansurarisoy
Contributor
0 Kudos

Oh, I misunderstood your problem. Can you check if you are able to access addon's js files from

https://<your-ccv2-url>/_ui/addons/<addon_ext_name>/responsive/js/<js_file_name>.js

It is possible that your addon configuration may not be correct in your manifest.json file. I suggest you to verify that the addons are configured correctly in manifest.json file.

You can also check the contents of wro_addons.xml with the following groovy

"cat /opt/hybris/bin/custom/<storefront_ext_name>/resources/wro_addons.xml".execute().text