Skip to content

This application shows loading profile-specific properties into spring context.

Notifications You must be signed in to change notification settings

saagarsonawane/spring-app-prop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-app-prop

This application shows loading profile-specific properties into spring context

  1. This application consists of spring's Web and JPA module
  2. This application uses @Configuration, @PropertySource annotation and 'Environment' API to load profile specific properties. application-{profile}.properties

Execution

This application has application-stg.properties and application-prd.properties file for stage and production environment resptively.

  1. To execute application in stage environment -
  • you may supply -Dspring.profiles.active=stg as VM arg
  • you may add spring.profiles.active=stg in default application.properties file
  • you may add --spring.profiles.active=stg as a program argument
    • java -jar spring-app-prop.jar --spring.profiles.active=stg
  1. To execute application in prod environment -
  • you may supply -Dspring.profiles.active=prd as VM arg.
  • you may add spring.profiles.active=prd in default application.properties file
  • you may add --spring.profiles.active=prd as a program argument
    • java -jar spring-app-prop.jar --spring.profiles.active=prd

About

This application shows loading profile-specific properties into spring context.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages