6

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?

vforchi
  • 123
  • 2
  • 7
  • How do you build? – Max Aug 02 '17 at 08:49
  • As far as I see `executable` is removed from `2.0.0-M3` and both jar and war are executable by default. – Opal Aug 02 '17 at 08:58
  • The jar file is not executable, and even if I change the permission I get an error when I try to execute it. I'm not sure how this thing should work at all, the documentation is a bit fuzzy. Max, what do you mean? I run `./gradlew build` – vforchi Aug 02 '17 at 09:56

1 Answers1

21

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.

Andy Wilkinson
  • 108,729
  • 24
  • 257
  • 242