Profile setting for spring boot
Build with maven
- Go to target folder and find the jar
- For dev mode: java -jar spring-profile-0.0.1-SNAPSHOT.jar
- For prod mode: java -jar -Dspring.profiles.active=prod spring-profile-0.0.1-SNAPSHOT.jar
2022-01-20 22:03:20.562 INFO 10188 --- [ main] o.r.c.profile.SpringProfileApplication : The following profiles are active: prod 2022-01-20 22:03:23.064 INFO 10188 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 1005 (http)
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Web
The following guides illustrate how to use some features concretely: