liquibase.configuration.ConfigurationValueProvider implementations define where and how to look up configuration settings exposed through the
The configuration settings looked up through these providers are used by both global and command-specific settings.
When a specific configuration key is looked for, Liquibase will check for the value in all registered ConfigurationValueProviders.
Each ConfigurationValueProvider has a
getPrecedence() method which controls which value "wins" if it is configured in multiple places.
The standard provider precedence is:
- 250 Integration-specific providers such as "CLI Arguments"
If the value provider can be dynamically discovered, it must have a no-arg constructor and be registered in
If it will be created programmatically by an integration, it can accept required fields in the constructor and should NOT be registered.
Returns where the value provider falls in the hierarchy of locations to check for values.
Looks up the given configuration key in the source data.
The key(s) passed will be the canonical/standard key for the property (such as
liquibase.shouldRun) plus any aliases that may apply.
It is up to implementations to provide any "smoothing" to handle differences in case, word separators, etc. that may be expected from how the data is stored
and to check for all passed keys. If multiple passed keys match, return the value from the first key in the array.
keyMatches() instead of this method.
getMap() / keyMatches()
keyMatches() replace needing to implement
getMap() method is called when a value is first requested from the instance.
keyMatches() method is for defining the "smoothing" logic that handles differences in case, word separators, etc. that may be expected from how the data is stored.
For example, EnvironmentVariableValueProvider checks case-insensitively and replaces
If you are not extending
AbstractMapConfigurationValueProvider these methods will not exist, so you will have to implement
The complete javadocs for
liquibase.configuration.ConfigurationValueProvider is available at https://javadocs.liquibase.com
The following guides provide relevant examples:
Created: March 28, 2023