Failed to Configure a DataSource error in Spring Boot

Add dependency for PostgreSQL JDBC Driver

Declare the following dependency in your project’s pom.xml file:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <scope>runtime</scope>
</dependency>

Add in application.properties this configuration, especially the last line for the driver

   spring.datasource.url=jdbc:postgresql:<db-info>
   spring.datasource.username=<user>
   spring.datasource.password=<password>
   spring.datasource.driver-class-name=org.postgresql.Driver

Reference here for more: https://docs.spring.io/spring-cloud-dataflow/docs/1.1.2.RELEASE/reference/html/configuration-rdbms.html