Properties Files in Hybris
Lets understand the properties files in Hybris
We basically have 3 main properties files in Hybris to put the configuration values in the form of key value pair.
1) project.properties file in platform folder
2) project.properties file in each extension
3) local.properties file in config folder
Project.properties file in platform folder
This file contains the basic platform related configuration values which includes Database related propertis,XSS filter properties etc.
project.properties file in each extension
This file contains the configuration values specific to an extension.
Each and every extension will have their own project.properties file.
And any properties specified in this file will take more precedence than project.properties file in platform folder.
Local.properties file in config folder
This file contains the properties which are common across all the extensions.
If we define the properties in this file, any extension in Hybris including custom extensions can access it.
Properties defined in this file will take more precedence than properties defined in any other properties file.
Priority in properties file
Remember that the precedence of properties files is as below
We can find all the properties defined in any of the above location in the HAC
Login to HAC and go to Platform/configuration
We can search specific key in the search box.
We can also change the values of the keys dynamically and add the new key value pair as well.
We are changing abstractorder.taxFreeEntrySupport value from false to true as below
Note:
We can do changes in all project.properties files except the one in platform folder.
Changing values or adding new key value pairs in HAC directly will be lost after restarting the Server.
So it’s essential to modify the values or add the key value pairs inside the properties file so that it remains forever.
Hello, can we override any properties of hybris platform’s tomcat wrapper conf for example using local or any other properties file?
Hi KB.. Am also working in Hybris last one year.. Not able to get study materials for certification.. Nobody in teams, they are not ready to share.. Please help me where I can get it or please mail me if you any materials… It will be very great help for me .. My ID : rrajabe2007@gmail.com.. Thanks in advance
Thanks for this informative blog. I want to remove Junit tenant from productive instance of Hybris. I understand that i need to make changes to local.properties by adding installed.tenants=””
My question is, is this correct? If yes then, do i need a restart after this change?
Thanks in advance.
hi kb,
I create a new properties file,for example newxx.properties.Now I want to visit the properties file, or I want to active the properties,how to do?
Because I use class “Config” to visit properties value ,I can’t get it.
thanks
Hello Kb,
thank you for the useful information about java and hybris ,
i want to use a custom localmy.properties file, i found this this solution ant –Duseconfig=my , hybris write in logs that it uses this config file but it always still use the proprties in local.properties file, do you have a solution for this,
Best Regards.
Hello KB
Thanks for providing such useful information on Hybris.I just want to ask one thing that from where I can get hybris certification material.PLease guide me on the same
Can we do changes in project.properties? I guess no.
We can do changes in all project.properties files except the one in platform folder.
Hi KB
This site is very useful to learn Hybris mainly for fresher…….. Thanks
I am also learning Hybris through this site only.
Here, can you tell something about base.properties(i.e in which case we are using base.properties)
Thank you Rahul !!
This article talks about only configuration properties.
base properties basically used to put messages for each locale, like base_en.properties will have messages in english.
So based on the locale set in the site, corresponding messages in that language can be shown.
If you are new to locale, read more Here