Skip to content

Commit

Permalink
Clarify requirement of application.properties to load profile-aware f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
radcortez committed Sep 18, 2024
1 parent 8e6e43d commit ca4576d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Setting `quarkus.profile` to `staging` will activate the `staging` profile.
The `io.smallrye.config.SmallRyeConfig#getProfiles` API provides a way to retrieve the active profiles programmatically.
====

=== Profile aware files
=== Profile-aware files

Check warning on line 373 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.HeadingPunctuation] Do not use end punctuation in headings. Raw Output: {"message": "[Quarkus.HeadingPunctuation] Do not use end punctuation in headings.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 373, "column": 13}}}, "severity": "INFO"}

In this case, properties for a specific profile may reside in an `application-{profile}.properties` named file. The previous

Check warning on line 375 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'might (for possibility)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'might (for possibility)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 375, "column": 49}}}, "severity": "WARNING"}
example may be expressed as:

Check warning on line 376 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'might (for possibility)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'might (for possibility)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 376, "column": 9}}}, "severity": "WARNING"}

Check warning on line 376 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 376, "column": 26}}}, "severity": "INFO"}
Expand All @@ -391,19 +391,22 @@ quarkus.http.test-port=9191

[NOTE]
====
In this style, the configuration names in the profile aware file do not need to be prefixed with the profile name.
In this style, the configuration names in the profile-aware file do not need to be prefixed with the profile name.

Check warning on line 394 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 394, "column": 73}}}, "severity": "INFO"}
Properties in the profile aware file have priority over profile aware properties defined in the main file.
Properties in the profile-aware file have priority over profile-aware properties defined in the main file.
====

[WARNING]
====
Do not use profile aware files to set `quarkus.profile` or `quarkus.test.profile`. This will not work because the
profile is required in advance to load the profile aware files.
Do not use profile-aware files to set `quarkus.profile` or `quarkus.test.profile`. This will not work because the
profile is required in advance to load the profile-aware files.
====

A profile aware file is only loaded if the unprofiled `application.properties` is also available in the same location
and the file extension matches between the files. This is required to keep a consistent loading order and pair all the
resources together.
[IMPORTANT]
====
An `application.properties` file must exist (even if empty) in the exact location of the profile-aware
(`application-{profile}.properties`) file to be included in the configuration to ensure a consistent order when
loading the files.
====

=== Parent Profile

Check warning on line 412 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.HeadingPunctuation] Do not use end punctuation in headings. Raw Output: {"message": "[Quarkus.HeadingPunctuation] Do not use end punctuation in headings.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 412, "column": 13}}}, "severity": "INFO"}

Check warning on line 412 in docs/src/main/asciidoc/config-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in '4.5. Parent Profile'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in '4.5. Parent Profile'.", "location": {"path": "docs/src/main/asciidoc/config-reference.adoc", "range": {"start": {"line": 412, "column": 13}}}, "severity": "INFO"}
Expand Down Expand Up @@ -435,8 +438,8 @@ Then

[WARNING]
====
Do not use Profile aware files to set `quarkus.config.profile.parent`. This will not work because the profile is
required in advance to load the profile aware files.
Do not use Profile-aware files to set `quarkus.config.profile.parent`. This will not work because the profile is
required in advance to load the profile-aware files.
====

=== Multiple Profiles
Expand Down

0 comments on commit ca4576d

Please sign in to comment.