Spring boot properties parsed incorrectly

Viewed 82

I have the below yaml property file in my spring-boot project. Refer the file code below :

db:
  useEmbedded: false
  type: postgres
  url: jdbc:postgresql://localhost:5432/postgres
  username: akhil
  password: akhil
  port: 5432

I am loading these properties using code :

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;

import java.util.List;

@ConstructorBinding
@ConfigurationProperties
public class AppProperties {

    public static class DB {
        public final boolean useEmbedded;
        public final String type;
        public final String url;
        public final String name;
        public final String username;
        public final String password;
        public final int port;

        public DB(boolean useEmbedded, String type, String url, String name, String username, String password, int port) {
            this.useEmbedded = useEmbedded;
            this.type = type;
            this.url = url;
            this.name = name;
            this.username = username;
            this.password = password;
            this.port = port;
        }
    }

    public final DB db;

    public AppProperties(DB db {
        this.db = db;
    }
}

Out of all the property file configurations, encoded values are loaded for url, username, password.

I am getting the encrypted value instead of getting it as plain text, refer below :

url : xqs9UXmQlYvyC50qx1GqcnYtIRM5/RewTgdPLmedu8qmaARZNfOMMwYswjk5AMIlS1bGWHC1GaTdlbhlMfRobHfUKwXLTKMUJH5zu87G1pQ8Et4KXLxFQ6xaPIcDtDhB
username : GxVMYrjHGKc4Nee1ftfoig==
password : M2LTxSQtjJKOZLJPwB1sZg==

It is the case in the Ubuntu-20.04 but this is working fine in Mac-OS where i get the actual plain text value. The IDE which i am using is Intellij-community-edition.

1 Answers
Related