Hybris Installation


Hybris commerce suite comes with .zip file which contains all the files required to work with Hybris.


Lets see the steps to setup the Hybris


Step 1: Download and Unzip Hybris suite

Download Hybris Zip file from SAP Market place.

Copy it to one of the folder in your local system,I have copied it in E:\practice folder(I will be using this folder for all hybris folder path, please adjust it accordingly in your system)

I am using Hybris 5.6

Unzip the zipped file using 7 zip(if you don’t have 7 zip,please download from Here) to the same folder.

hybris_unzip

Delete the zipped folder of Hybris from this path.

Step 2: Installing Recipe


Recipe concept is available from Hybris 5.5 and later versions.
It is used to install B2C accelerators,B2B accelerators ,Telco accelerators etc

Before installing Recipe, observe that we can find only bin folder inside hybris folder.

Go to installer path in command prompt
E:\practice\installer install.bat –r b2c_acc_plus
(syntax is install.bat –r recipeName)
This command is used to install the recipe

recipe

This command will add the required extensions to the localextensions.xml file as per the recipe name we have provided in the command.

Now we can see that Recipe command ran successfully

Now open the hybris folder and check the folders created

Inside config folder, we can see that localextensions.xml got created with all the extensions specified in the given recipe.

localextensions.xml after installing Recipe looks like below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<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='mcc' />
    <extension name='backoffice' />
    <extension name='commercesearchbackoffice' />
    <extension name='yacceleratorcockpits' />
    <extension name='yacceleratorinitialdata' />
    <extension name='yacceleratorstorefront' />
    <extension name='yaddon' />
    <extension name='ycommercewebservices' />
    <extension name='electronicsstore' />
    <extension name='apparelstore' />
    <extension name='captchaaddon' />
    <extension name='b2ccheckoutaddon' />
    <extension name='liveeditaddon' />
    <extension name='acceleratorwebservicesaddon' />
  </extensions>
</hybrisconfig>
<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='mcc' />
    <extension name='backoffice' />
    <extension name='commercesearchbackoffice' />
    <extension name='yacceleratorcockpits' />
    <extension name='yacceleratorinitialdata' />
    <extension name='yacceleratorstorefront' />
    <extension name='yaddon' />
    <extension name='ycommercewebservices' />
    <extension name='electronicsstore' />
    <extension name='apparelstore' />
    <extension name='captchaaddon' />
    <extension name='b2ccheckoutaddon' />
    <extension name='liveeditaddon' />
    <extension name='acceleratorwebservicesaddon' />
  </extensions>
</hybrisconfig>

We can find all the available recipe in hybris under below directory
E:\practice\installer\recipes

Step 3: Modulegen


Its an Ant command used to generate the set of logically related extensions at once.

Navigate to platform folder in command prompt
Run the below command

setantenv.bat

Now run the modulegen command as below in the same command window
ant modulegen -Dinput.module=accelerator -Dinput.name=training -Dinput.package=com.hybris.training -Dinput.template=develop

we have specified module as accelerator which means we are developing B2C module.

we can specify any name to the module, we have given training for the same.

We can also specify the java class package prefix, we have given as com.hybris.training

Template specifies whether configuration is for development or production.

We have given it as develop as we are doing for development environment.

We should be able to see the Build success in the command prompt as below

You can see the next steps to be performed in the command prompt

Just do the first 2 steps, and then localextensions.xml should be as below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<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='mcc' />
    <extension name='backoffice' />
    <extension name='commercesearchbackoffice' />
    <extension name='trainingfulfilmentprocess' />
    <extension name='trainingcore' />
    <extension name='trainingfacades' />
    <extension name='trainingtest' />
    <extension name='trainingstorefront' />
    <extension name='traininginitialdata' />
    <extension name='trainingcockpits' />
    <extension name='yaddon' />
    <extension name='ycommercewebservices' />
    <extension name='electronicsstore' />
    <extension name='apparelstore' />
    <extension name='captchaaddon' />
    <extension name='b2ccheckoutaddon' />
    <extension name='liveeditaddon' />
    <extension name='acceleratorwebservicesaddon' />
  </extensions>
</hybrisconfig>
<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='mcc' />
    <extension name='backoffice' />
    <extension name='commercesearchbackoffice' />
    <extension name='trainingfulfilmentprocess' />
	<extension name='trainingcore' />
	<extension name='trainingfacades' />
	<extension name='trainingtest' />
	<extension name='trainingstorefront' />
    <extension name='traininginitialdata' />
	<extension name='trainingcockpits' />
    <extension name='yaddon' />
    <extension name='ycommercewebservices' />
    <extension name='electronicsstore' />
    <extension name='apparelstore' />
    <extension name='captchaaddon' />
    <extension name='b2ccheckoutaddon' />
    <extension name='liveeditaddon' />
    <extension name='acceleratorwebservicesaddon' />
  </extensions>
</hybrisconfig>


Step 4: Run ant clean all

Run ant clean all command in the command prompt
Make sure the build is success

Step 5: Start the hybris server


Start the Hybris server using the below command

hybrisserver.bat debug


Step 6: Initialization


We can do the initialization of the system in 2 ways

a)Using below command in command prompt
ant initialize

b) Initialize from HAC directly.

Lets do it using HAC

Access the below url
http://localhost:9001
make sure Toggle all checkbox is selected.

click on initialize button and confirm the initialization

This will take considerable amount of time based on the system memory and processor as it creates new DB schema, tables and loads the configured data.

Wait till the initialization gets finished as shown in below image.


Step 7


Enter below URL mappings in Host file in the below path
C:\Windows\System32\drivers\etc

1
2
127.0.0.1   apparel.local
127.0.0.1   electronics.local
127.0.0.1   apparel.local
127.0.0.1   electronics.local


Step 8


Accessing sample sites

Now try to access the sample sites shipped with Hybris using below url

Apparel UK site
http://apparel.local:9001/trainingstorefront/?site=apparel-uk

Apparel-uk-site

Similarly access the below sites as well

Apparel-DE site
http://localhost:9001/ trainingstorefront/?site=apparel-de

Electronics site
http://localhost:9001/ trainingstorefront/?site=electronics

All these are sample B2C sites shipped by Hybris itself.

Once we are able to access these sites, we can confirm that we have installed and configured the hybris successfully in our local machine.

About the Author

Karibasappa G C (KB)
Founder of javainsimpleway.com
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to kb.knowledge.sharing@gmail.com

Connect with me on Facebook for more updates

Share this article on