Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot: Boot Run cannot add addResources = true

In Kotlin, on Intellij using gradle to run the task bootRun for Spring Boot, I get the error that follows:

 BUILD FAILED

 Total time: 0.085 secs
 Could not set unknown property 'addResources' for task ':bootRun' 
 of type org.springframework.boot.gradle.tasks.run.BootRun.

I am using kotlinVersion = '1.1.4-3', springBootVersion = '2.0.0.M3' and my bootrun task looks like the following in my gradle.build

bootRun
    {
         addResources = true
    }

My bootRun works as expected without the adjustments to the bootRun task

like image 686
DCourtney Avatar asked Sep 15 '17 07:09

DCourtney


1 Answers

You are using Spring Boot 2.0 where the addResources property no longer exists. Instead, you need to set the sourceResources property to the source set that you want to use. Typically that’s sourceSets.main. This is described in the plugin’s documentation.

like image 158
Andy Wilkinson Avatar answered Sep 24 '22 17:09

Andy Wilkinson