- Primary file:
dotCMS/src/main/resources/dotmarketing-config.properties - Use for: General application configuration, new features, most properties
For properties related to specific domains that already have dedicated files:
-
Cluster config:
dotCMS/src/main/resources/dotcms-config-cluster.properties- Use for: Clustering, ES endpoints, reindexing, heartbeat settings
- Example properties:
ES_ENDPOINTS,HEARTBEAT_TIMEOUT,REINDEX_THREAD_*
-
SAML config:
dotCMS/src/main/resources/dotcms-saml-default.properties- Use for: SAML authentication configuration
-
Database config:
dotCMS/src/main/resources/db.properties- Use for: Database connection settings
-
Portal config:
dotCMS/src/main/resources/portal.properties- Use for: Portal/legacy configuration
- Check existing files first: If your property relates to functionality already configured in a specialized file, add it there
- Use main config for new domains: For new features or general configuration, use
dotmarketing-config.properties - Don't create new specialized files: Avoid creating new
.propertiesfiles unless absolutely necessary
Use lowercase dot-separated format:
# Correct format
shutdown.timeout.seconds=30
shutdown.component.timeout.seconds=10
experiments.enabled=true
health.detailed.authentication.required=trueUse the same lowercase dot-separated format with Config class:
// Correct usage
Config.getIntProperty("shutdown.timeout.seconds", 30)
Config.getBooleanProperty("experiments.enabled", false)
Config.getStringProperty("health.detailed.authentication.required", "true")The Config class automatically transforms properties:
shutdown.timeout.seconds→DOT_SHUTDOWN_TIMEOUT_SECONDSexperiments.enabled→DOT_EXPERIMENTS_ENABLEDhealth.detailed.authentication.required→DOT_HEALTH_DETAILED_AUTHENTICATION_REQUIRED
- Environment variables (with
DOT_prefix) - System table (database)
- Properties files (all files are loaded)
When adding new properties, include:
# Purpose description (default: value)
# Environment variable: DOT_PROPERTY_NAME
property.name=default_value# In dotmarketing-config.properties
health.detailed.authentication.required=true
# In Java code
Config.getBooleanProperty("health.detailed.authentication.required", true)
# Environment variable override
DOT_HEALTH_DETAILED_AUTHENTICATION_REQUIRED=false# In dotcms-config-cluster.properties
ES_ENDPOINTS=http://localhost:9200
HEARTBEAT_TIMEOUT=600
# In Java code
Config.getStringProperty("ES_ENDPOINTS", "http://localhost:9200")
Config.getIntProperty("HEARTBEAT_TIMEOUT", 600)# In dotmarketing-config.properties
shutdown.timeout.seconds=30
shutdown.graceful.logging=true
# In Java code - ShutdownCoordinator
Config.getIntProperty("shutdown.timeout.seconds", 30)
Config.getBooleanProperty("shutdown.graceful.logging", true)
# Environment variable override
DOT_SHUTDOWN_TIMEOUT_SECONDS=45
DOT_SHUTDOWN_GRACEFUL_LOGGING=false# Don't use uppercase
SHUTDOWN_TIMEOUT_SECONDS=30
# Don't use dotcms prefix in properties file
dotcms.shutdown.timeout=30// Don't use uppercase in code
Config.getIntProperty("SHUTDOWN_TIMEOUT_SECONDS", 30)
// Don't use System.getProperty directly
System.getProperty("shutdown.timeout.seconds")# Don't put cluster config in main file if it belongs in cluster file
# In dotmarketing-config.properties (WRONG)
es.endpoints=http://localhost:9200
# Should be in dotcms-config-cluster.properties (CORRECT)
ES_ENDPOINTS=http://localhost:9200# Don't create new specialized files unnecessarily
dotCMS/src/main/resources/shutdown.properties # Bad
dotCMS/src/main/resources/my-feature.properties # Bad
- Check specialized files first for domain-specific properties
- Use
Config.getProperty()for all configuration access - Properties use lowercase dot-separated naming in code
- Environment variables automatically get
DOT_prefix and uppercase conversion - Add general properties to
dotmarketing-config.properties - Add domain-specific properties to existing specialized files
- Document environment variable names in comments