Previous posts:
Part 1 - Data Model
Part 2 - IMPEX
Part 3 - Dynamic Attributes
Enumerate places of definition configurable properties.
- global properties - local.properties file is located in ${HYBRIS_CONFIG_DIR}
- extension-specific project.properties file in ${EXTENSION_DIR}
- platform-specific project.properties file in ${HYBRIS_BIN_DIR}>/platform
You have the same properties in different extensions. What value will be set in the system?
extensionA/project.properties
1 | true = |
extensionB/project.properties
1 | false = |
We can’t explicitly define what the value will because Hybris doesn’t define a strict order for processing extensions. To override the value define it in config/local.properties:
1 | false = |
You have some properties. What is the best place to put it?
1 | ############################################## |
Set 1 - looks like these are very special properties not typically used by a customer.
The official documentation recommends put very special properties in advanced.properties
Set 2 - looks like these are low-level platform properties.
The official documentation recommends put low-level platform properties in platform/project.properties
Set 3 - looks like these are extension-related properties.
The official documentation recommends put extension-related properties in extensions/project.properties
Set 4 - looks like these are project-related properties.
The official documentation recommends put project related properties in config/local.properties
What value will be set in the system?
config/local.properties
1 | false = |
extension/project.properties
1 | true = |
platform/project.properties
1 | = |
In the system will be set property.legacymode=false because local.properties overrides other properties.
I don’t want to store passwords/logins to establish a connection to the database in local.properties. What can I do?
config/local.properties
1 | # I don't want to store it here |
You can use Environment Variables instead of storing values in properties files. Those variables always override variables from any properties file. Properties are defined as environment variables always override those from any properties file.
For to do this:
- Remove valid values from local.properties:
1
2
3<CHANGE_ME> =
<CHANGE_ME> =
<CHANGE_ME> = - Pass values before start server:
1
2
3
4hybris-user$ export y_db_url=jdbc:oracle:thin:@amrood:1521:EMP
hybris-user$ export y_db_username=hybris
hybris-user$ export y_db_password=SoMePas5w00rD
hybris-user$ ./hybrisserver.sh start
Created based on official documentation
Follow me in the group in telegram