convert application.yml file to application.properties

Sudhanshu Saini picture Sudhanshu Saini · Aug 28, 2018 · Viewed 11.2k times · Source

I have my application.yml file as below. How to convert it to application.properties I am trying it but how can i write multiple properties in same file. Its giving me duplicate kery error.

 ---
  spring:
    profiles: peer1
  eureka:
     instance:
        hostname: peer1
     client:
        serviceUrl:
           defaultZone: http://peer2/eureka/

 ---
 spring:
    profiles: peer2
 eureka:
    instance:
      hostname: peer2
    client:
      serviceUrl:
         defaultZone: http://peer1/eureka/

Answer

Satakshi Pandey picture Satakshi Pandey · Jul 29, 2020

IntelliJ and other IDEs provide plugins for the same.

For eg- https://plugins.jetbrains.com/plugin/13804-convert-yaml-and-properties-file

Install the plugin, right click on your yaml or properties file and choose - "Convert yaml and properties file".