Skip to content

Commit

Permalink
Support .env file by default (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez authored Jul 4, 2024
1 parent 79de339 commit d61a0d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions documentation/src/main/docs/config/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ By default, SmallRye Config reads configuration properties from multiple configu

1. (`400`) System properties
2. (`300`) Environment variables
3. (`260`) `application.properties` in `config` folder, located in the current working directory
3. (`250`) `application.properties` in the classpath
4. (`100`) MicroProfile Config configuration file `META-INF/microprofile-config.properties` in the classpath
3. (`295`) `.env` file in the current working directory
4. (`260`) `application.properties` in `config` folder, located in the current working directory
5. (`250`) `application.properties` in the classpath
6. (`100`) MicroProfile Config configuration file `META-INF/microprofile-config.properties` in the classpath

A configuration source is handled by a `ConfigSource`. A `ConfigSource` provides configuration values from a specific
place.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ protected List<ConfigSource> getDefaultSources() {

protected List<ConfigSource> getSystemSources() {
List<ConfigSource> sources = new ArrayList<>();
sources.add(new EnvConfigSource());
sources.add(new SysPropConfigSource());
sources.add(new EnvConfigSource());
sources.addAll(new DotEnvConfigSourceProvider().getConfigSources(classLoader));
return sources;
}

Expand Down

0 comments on commit d61a0d7

Please sign in to comment.