• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Reload external .yml file in spring boot

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to reload the external .yml file in Spring Boot.

I able to achieve this from .properties file by following example.

https://github.com/eugenp/tutorials/tree/master/spring-boot-modules/spring-boot-properties

I am not able to achieve this with .yml file.

Could anyone can help on this.
 
Bartender
Posts: 1945
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you are talking about running the MyApplication under yaml directory, you need to specify an active profile.
In IntelliJ, click "Run" , select "edit configuration". In the VM options, put  -Dspring.profiles.active=prod .
Then, you will be able to load the properties from the application.yml.
runConfig.JPG
edit configuration screen shot
edit configuration screen shot
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic