Install & Customize SAP Commerce [Hybris] B2C Site using ant modulegen

In this article I am going to demonstrate, how to install and customize our own SAP Commerce [Hybris] B2C site using modulegen command.

ant modulegen command can be used to create the module, which contains set of extensions based on the module template we selected.

Step1: Download SAP Hybris / SAP Commerce suite from SAP Portal and extract in a folder as shown below:



Step2: Install SAP Commerce using installer recipe [cx]:

            Before installing recipe, we can see only bin folder under hybris as show below:

            Now go to the installer path and install using cx recipe:
            Syntax: installer.bat -r recipe_name local_property:initialpassword.admin=PASSWORD
                          install.bat -r cx -A local_property:initialpassword.admin=nimda


Note: This recipe command will add required extensions to the localextensions.xml file based on the recipe name & now we can see other folders in hybris folder:

We can also see localextensions.xml file generated under config folder by adding set of required extensions:

<hybrisconfig xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../bin/platform/resources/schemas/extensions.xsd'>

  <extensions>

    <path dir='${HYBRIS_BIN_DIR}' autoload='false' />

    <extension name='yb2bacceleratorstorefront' />

    <extension name='adaptivesearch' />

    ….….

  </extensions>

</hybrisconfig>


Step4: Run ant clean all.
            We can run the ant clean all command for the first time installing hybris suite.




Step5: Run ant modulegen command.
            ant modulegen command can be used to create the module and it creates set of extensions based on the module template we selected.

We can choose default accelerator template, choose module extension name as 'training' and
give base package name for our extensions as 'com.hybris.training'.

Once ant modulegen run successfully you can see below message in console and follow the same steps mentioned:


Step6: Start Hybris Server from platform folder.


Step7: Initialize SAP Commerce from HAC.
           When you install the hybris suite first time then we have to initialize the system as shown below:


Step8: Add below entries in the hosts file from below path:
C:\Windows\System32\drivers\etc
127.0.0.1   apparel.local
127.0.0.1   electronics.local
127.0.0.1   powertools.local

Step9: Access B2C site[which has set of custom extensions] using below URL:
    Electronics site
    http://localhost:9001/trainingstorefront/?site=electronics



HAPPY Learning😊😊😊






Comments

Popular posts from this blog

Type System in SAP Commerce [Hybris]

Differences between Extension and AddOn in SAP Hybris

items.xml in SAP Commerce [Hybris]