Liferay OSGi Config Generator
Generate Liferay OSGi .config files for osgi/configs. Pick a component for a typed property form, or use custom mode for any PID. Correct Felix format.
1. Choose a component
2. Configure properties
Connect to a remote production Elasticsearch cluster. Replaces the deprecated Operation Mode.
BooleanDeprecated. REMOTE connects to a standalone cluster; EMBEDDED runs a dev-only internal instance.
StringName of the Elasticsearch cluster to connect to. Must match the remote cluster name.
StringURL of each Elasticsearch node (one per line).
String[]Username for a secured (X-Pack) cluster.
StringPassword for the configured username.
StringEnable HTTPS/TLS when connecting to the cluster.
BooleanAdd another property
3. Generated com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config
Drop this file into [Liferay Home]/osgi/configs/.
Prefer the plain .cfg format? (com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.cfg)
The .config format is preferred — it carries types and supports multi-valued properties. Use .cfg only for simple scalar values.
Liferay .config Files, Done Right
Liferay reads OSGi configuration files from [Liferay Home]/osgi/configs. The preferred format, .config, is the Apache Felix Config Admin format — typed and array-capable, but easy to get wrong by hand. This generator produces correct output for known components (with a typed form of their real properties) and for any other component via custom mode.
.config Format Reference
| Type | Syntax | Example |
|---|---|---|
| String | key="value" | clusterName="LiferayElasticsearchCluster" |
| Boolean | key=B"true" | productionModeEnabled=B"true" |
| Integer | key=I"5" | journalArticleMaxVersionCount=I"5" |
| Long | key=L"10" | termsOfUseGroupId=L"0" |
| Double | key=D"1.5" | ratio=D"1.5" |
| Array | key=["a","b"] | networkHostAddresses=["http://localhost:9200"] |
Note: no space after the comma in arrays (a space silently voids the property), and escape ", =, and spaces-in-array-values with a backslash. The generator does all of this.
Known Components
Jump straight to a component's pre-loaded form:
Frequently Asked Questions
- What is a Liferay .config file?
- It is an OSGi configuration file you place in [Liferay Home]/osgi/configs to configure a component without using the System Settings UI. Liferay reads it on startup (and on change) and applies the values to the matching configuration PID.
- Why use .config instead of .cfg?
- Both work in osgi/configs, but .config uses the Apache Felix format, which lets you specify a value's type and use multi-valued (array) properties. .cfg is plain key=value properties and is fine only for simple scalar values. This tool generates both.
- How are values typed in a .config file?
- Strings are quoted (key="value"). Other scalars get a type marker before the quote: B for boolean (enabled=B"true"), I for integer (maxSize=I"5"), L for long, D for double. Arrays use bracket notation with no space after the comma: hosts=["a","b"]. This tool emits all of that for you.
- What is the array gotcha?
- In a .config array, a space after the comma silently voids the whole property. Values are also split on spaces, so spaces inside a value must be backslash-escaped (e.g. "Liferay\ Marketplace"). The generator handles this automatically.
- How do I name a factory configuration file?
- Factory configurations (one instance per file, like an LDAP server) use the pattern pid~alias.config, where alias is any unique sub-name. Enter a factory alias in the form and the filename updates automatically.
- My component is not in the list — can I still use it?
- Yes. Choose "Custom configuration", paste any PID, and add typed properties. The curated list covers common components with verified properties; custom mode works for all of the hundreds of others.