When Gradle’s {java-plugin}[java
plugin] is applied to a project, the Spring Boot plugin:
-
Creates a {boot-jar-javadoc}[
BootJar
] task namedbootJar
that will create an executable, fat jar for the project. The jar will contain everything on the runtime classpath of the main source set; classes are packaged inBOOT-INF/classes
and jars are packaged inBOOT-INF/lib
-
Configures the
assemble
task to depend on thebootJar
task. -
Configures the
jar
task to useplain
as the convention for its archive classifier. -
Creates a {boot-build-image-javadoc}[
BootBuildImage
] task namedbootBuildImage
that will create a OCI image using a buildpack. -
Creates a {boot-run-javadoc}[
BootRun
] task namedbootRun
that can be used to run your application. -
Creates a configuration named
bootArchives
that contains the artifact produced by thebootJar
task. -
Creates a configuration named
developmentOnly
for dependencies that are only required at development time, such as Spring Boot’s Devtools, and should not be packaged in executable jars and wars. -
Creates a configuration named
productionRuntimeClasspath
. It is equivalent toruntimeClasspath
minus any dependencies that only appear in thedevelopmentOnly
configuration. -
Configures any
JavaCompile
tasks with no configured encoding to useUTF-8
. -
Configures any
JavaCompile
tasks to use the-parameters
compiler argument.
When {kotlin-plugin}[Kotlin’s Gradle plugin] is applied to a project, the Spring Boot plugin:
-
Aligns the Kotlin version used in Spring Boot’s dependency management with the version of the plugin. This is achieved by setting the
kotlin.version
property with a value that matches the version of the Kotlin plugin. -
Configures any
KotlinCompile
tasks to use the-java-parameters
compiler argument.
When Gradle’s {war-plugin}[war
plugin] is applied to a project, the Spring Boot plugin:
-
Creates a {boot-war-javadoc}[
BootWar
] task namedbootWar
that will create an executable, fat war for the project. In addition to the standard packaging, everything in theprovidedRuntime
configuration will be packaged inWEB-INF/lib-provided
. -
Configures the
assemble
task to depend on thebootWar
task. -
Configures the
war
task to useplain
as the convention for its archive classifier. -
Configures the
bootArchives
configuration to contain the artifact produced by thebootWar
task.
When the {dependency-management-plugin}[io.spring.dependency-management
plugin] is applied to a project, the Spring Boot plugin will automatically import the spring-boot-dependencies
bom.
When Gradle’s {application-plugin}[application
plugin] is applied to a project, the Spring Boot plugin:
-
Creates a
CreateStartScripts
task namedbootStartScripts
that will create scripts that launch the artifact in thebootArchives
configuration usingjava -jar
. The task is configured to use theapplicationDefaultJvmArgs
property as a convention for itsdefaultJvmOpts
property. -
Creates a new distribution named
boot
and configures it to contain the artifact in thebootArchives
configuration in itslib
directory and the start scripts in itsbin
directory. -
Configures the
bootRun
task to use themainClassName
property as a convention for itsmain
property. -
Configures the
bootRun
task to use theapplicationDefaultJvmArgs
property as a convention for itsjvmArgs
property. -
Configures the
bootJar
task to use themainClassName
property as a convention for theStart-Class
entry in its manifest. -
Configures the
bootWar
task to use themainClassName
property as a convention for theStart-Class
entry in its manifest.
Warning
|
Support for reacting to Gradle’s maven plugin is deprecated and will be removed in a future release.
Please use the maven-publish plugin instead.
|
When Gradle’s {maven-plugin}[maven
plugin] is applied to a project, the Spring Boot plugin will configure the uploadBootArchives
Upload
task to ensure that no dependencies are declared in the pom that it generates.