Spring Boot Gradle Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 21: Line 21:
=Packaging=
=Packaging=


Executable JARs are created by the bootJar task. The task is automatically created with the [[Gradle_Java_Plugin#Overview|java plugin]] is applied. It is an instance of [https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/gradle-plugin/api/org/springframework/boot/gradle/tasks/bundling/BootJar.html BootJar].
Executable JARs are created by the bootJar task. The task is automatically created with the [[Gradle_Java_Plugin#Overview|java plugin]] is applied. It is an instance of [https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/gradle-plugin/api/org/springframework/boot/gradle/tasks/bundling/BootJar.html BootJar]. bootJar can be configured with:
 
<syntaxhighlight lang='groovy'>
bootJar {
 
    // enable (default)/disable the task
    // enabled = true | false
}
</syntaxhighlight>
 
 
When bootJar or bootWar tasks are configured, the jar or war tasks are disabled. The jar task can be enabled with:
 
<syntaxhighlight lang='groovy'>
jar {
 
    enabled = true
}
</syntaxhighlight>

Revision as of 23:22, 31 October 2018

External

Internal

Overview

apply plugin: 'org.springframework.boot'

The plugin is responsible with:

  • packaging executable jar or war archives
  • run Spring Boot applications
  • use the dependency management provided by spring-boot-dependencies.

Packaging

Executable JARs are created by the bootJar task. The task is automatically created with the java plugin is applied. It is an instance of BootJar. bootJar can be configured with:

bootJar {

    // enable (default)/disable the task
    // enabled = true | false
}


When bootJar or bootWar tasks are configured, the jar or war tasks are disabled. The jar task can be enabled with:

jar {

    enabled = true
}