Spring Boot + Gradle: how to build executable jar

In Boot 2.x, the bootJar and bootWar tasks are responsible for packaging the application.

The bootJar task is responsible for creating the executable jar file. This is created automatically once the java plugin is applied.

In case the executable jar/war file is not generated run the below gradle task manually.

$./gradlew bootJar

Similarly, bootWar generates an executable war file and gets created once the war plugin is applied.

We can execute the bootWar task using:

$./gradlew bootWar

Note that for Spring Boot 2.x, we need to use Gradle 4.0 or later.

Leave a Comment

techhipbettruvabetnorabahisbahis forumu