DCourtney
DCourtney

Reputation: 123

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

Upvotes: 12

Views: 8928

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116261

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.

Upvotes: 30

Related Questions