this project shows how to use spring profiles for different environments and configurations.
- Java 1.8
- Spring Boot Web Application (embedded tomcat)
- Lombok
Install thelombok
plugin and activateEnable annotation processing
(IDEA Preferences).
no external dependencies
use the jvm parameter -Dspring.profiles.active
to configure the environment.
test
configures logback to use file logging and some test settings.prod
configures logback to use file logging and some production settings.
- server dude
-Dspring.profiles.active=prod,dude
$ JAVA_OPTS=-Dspring.profiles.active=test ./spring-profiles.jar