1.
A demo for spring-boot configuration loading24.3 Application property files
SpringApplication will load properties from application.properties files in the following locations and add them to the Spring Environment:
- A /config subdirectory of the current directory.
- The current directory
- A classpath /config package
- The classpath root
The list is ordered by precedence (properties defined in locations higher in the list override those defined in lower locations).
Diff
> git diff config resources --
diff --git a/config/application.properties b/config/application.properties
index 8bb6cc1..e69de29 100644
--- a/config/application.properties
+++ b/config/application.properties
@@ -1 +0,0 @@
-trap.key=config
\ No newline at end of file
Run
mvn clean spring-boot:run
- Click http://localhost:8080