1

I need to read docker-compose.yml file inside my spring boot application. I only need to read services that I have defined in yml file. My docker-compose.yml file as below.

https://gist.github.com/pubudu94/9cc5c46606c9a497d61058b096326dfe

I only need to read services names such as [abc,qqqq]. I tried this tutorial. https://dzone.com/articles/read-yaml-in-java-with-jackson but i don't want that much complex code for this small task. Do you have any suggestion ?

DAIRAV
  • 731
  • 1
  • 8
  • 29
Pubudu Jayasanka
  • 1,044
  • 2
  • 12
  • 33

1 Answers1

2

You can use SnakeYaml for this.

Refer below thread for more info.

https://stackoverflow.com/a/25797282/6572971

Alien
  • 13,439
  • 5
  • 35
  • 53