Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringBoot: can't create fully executable jar with 2.0.0-M3

I have a multi module Gradle project and I tried to upgrade to 2.0.0-M3. Following the instructions here, I added this to my build script:

springBoot {
    executable = true
}

But when I build I get the following error:

Could not set unknown property 'executable' for object of type org.springframework.boot.gradle.dsl.SpringBootExtension.

Is it something broken in the milestone or am I doing something wrong?

like image 265
vforchi Avatar asked Aug 02 '17 08:08

vforchi


1 Answers

The configuration for this has changed in Spring Boot 2.0. Rather than configuring it on the springBoot extension, it's now configured on an individual BootJar or BootWar task. For example:

bootJar {
    launchScript {
        included = true
    }
}

As of Spring Boot 2.0 M4, this configuration has been further simplified:

bootJar {
    launchScript()
}

You may want to open an issue to correct the documentation that you linked to as it's out of date.

like image 134
Andy Wilkinson Avatar answered Oct 23 '22 23:10

Andy Wilkinson