Skip to content

Latest commit

 

History

History

config

config

Showcasing configuration features of Spring Boot and the Spring Framework like Spring Profiles.

Instructions

Follow these instructions to build and run the example program.

  1. Pre-requisite: Java
    • I used Java 21
  2. Build the program distribution:
    • ./gradlew installDist
  3. Run the program:
    • ./build/install/config/bin/config
  4. Alternatively, enable a Spring Boot profile named "day" and run the program:
    • SPRING_PROFILES_ACTIVE=day ./build/install/config/bin/config
    • Notice how the fortune messages have changed.
  5. Try the "dynamic" profile too:
    • SPRING_PROFILES_ACTIVE=dynamic ./build/install/config/bin/config

Reference