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
  • 723
  • 1
  • 9
  • 31
Pubudu Jayasanka
  • 1,294
  • 4
  • 18
  • 34

1 Answers1

2

You can use SnakeYaml for this.

Refer below thread for more info.

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

Alien
  • 15,141
  • 6
  • 37
  • 57