I wanted to use a profile specific application.properties file for my Spring Boot application. But Gradle was not picking it up when I ran my launched with the following command:

gradle bootRun -Dspring.profiles.active=dev

The solution turned out be be simply adding the snippet below to my build.gradle file. This snippet is telling Gradle to pull in the system properties.

bootRun {
    systemProperties = System.properties
}

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required