:samples-dir: /home/tcagent1/agent/work/64493a816be20d5a/promote-projects/gradle/build/git-checkout/platforms/documentation/docs/build/working/samples/install/building-spring-boot-web-applications
:gradle-version: 9.1.0-rc-4

= Building Spring Boot Web Applications Sample

[.download]
- link:zips/sample_building_spring_boot_web_applications-groovy-dsl.zip[icon:download[] Groovy DSL]
- link:zips/sample_building_spring_boot_web_applications-kotlin-dsl.zip[icon:download[] Kotlin DSL]

NOTE: You can open this sample in an link:{userManualPath}/gradle_ides.html#gradle_ides[IDE that supports Gradle].

This sample shows how a Spring Boot Web application can be built with Gradle.
The application was generated using the https://start.spring.io/#!type=gradle-project[Spring Initializr].

====
include::sample[dir="kotlin",files="app/build.gradle.kts[]"]
include::sample[dir="groovy",files="app/build.gradle[]"]
====

To build and run the application:

[listing.terminal]
----
$ ./gradlew bootRun

> Task :app:bootRun

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

2019-11-12 22:14:43.819  INFO 1389 --- [           main] o.g.samples.SpringBootDemoApplication    : Starting SpringBootDemoApplication on localhost with PID 1389 (/home/user/build/classes/java/main started by user in /home/user)
2019-11-12 22:14:43.820  INFO 1389 --- [           main] o.g.samples.SpringBootDemoApplication    : No active profile set, falling back to default profiles: default
2019-11-12 22:14:44.108  INFO 1389 --- [           main] o.g.samples.SpringBootDemoApplication    : Started SpringBootDemoApplication in 5.537 seconds (JVM running for 5.8)

BUILD SUCCESSFUL
3 actionable tasks: 3 executed
----

For more information, we suggest reading link:{userManualPath}/getting_started_dev.html[Getting Started with Gradle].
You can also find https://spring.io/guides[Spring Boot related information inside the guides provided by the Spring team].

// TODO:Finalize Upload Removal - Issue #21439
